If this is your first visit, be sure to
check out the FAQ by clicking the
link above. You may have to register
before you can post: click the register link above to proceed. To start viewing messages,
select the forum that you want to visit from the selection below.

Enjoy an ad free experience by logging in. Not a member yet? Register.

Javascript Spot The Ball

I wonder if anyone can help me.

I'm looking for help with a JS based spot the ball competition.

Basically, we have an image, and once clicked on we'd like an image marker (a little X or something to mark the spot). We'll need to be able to put exactly 10 markers on an image, no more no less, and each click would put the coordinates of the marker into a hidden field on the page).

Some tips on how to actually do this would be great. That having been said, I know almost nothing about JS, so ideally someone doing it for us on a freelance basis would be perfect.

It's pretty simple. The only hard part is that capturing the x/y coordinates of where the mouse click occurs is browser dependent: MSIE of course does it slightly differently that all the other browsers.

It's trivial to overlay one image with another, and if the overlay image is a GIF image with transparency, then the parts of the image that are transparent won't block the main image.

Given the images, it's no more than a 30 minute project, give or take.

QUERY: You say no more and no less than 10 markers, but what happens if the user just refuses to cooperate and clicks on only 4 locations?? The web page will just sit there forever waiting for the rest of the clicks. Don't you want to put a time limit on the 10 clicks?

The 10 clicks thing, that's going to be hammered into them. Basically they're going to be paying for a block of 10 goes at this competition. I guess the best way to do it would be to grey out the submit button until they choose 10.

I figure there should be a "start over" button that'll remove their markers. Or maybe just an undo button that will remove the last marker they placed.

How much would you charge for doing this for me, if it's not too presumptuous of me to ask?