Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 4 of 4
  1. #1
    New to the CF scene
    Join Date
    May 2009
    Posts
    5
    Thanks
    1
    Thanked 0 Times in 0 Posts

    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.

    Thanks in advance.

    James.

  • #2
    Supreme Master coder! Old Pedant's Avatar
    Join Date
    Feb 2009
    Posts
    27,084
    Thanks
    80
    Thanked 4,553 Times in 4,517 Posts
    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?

  • #3
    New to the CF scene
    Join Date
    May 2009
    Posts
    5
    Thanks
    1
    Thanked 0 Times in 0 Posts
    Thanks for getting back to me so fast.

    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?

  • #4
    Supreme Master coder! Old Pedant's Avatar
    Join Date
    Feb 2009
    Posts
    27,084
    Thanks
    80
    Thanked 4,553 Times in 4,517 Posts
    Sent you a private message. Look for it.


  •  

    Tags for this Thread

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •