Go Back   CodingForums.com > :: Client side development > JavaScript programming

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 05-04-2009, 10:08 PM   PM User | #1
Jablesdactyl
New to the CF scene

 
Join Date: May 2009
Posts: 5
Thanks: 1
Thanked 0 Times in 0 Posts
Jablesdactyl is an unknown quantity at this point
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.
Jablesdactyl is offline   Reply With Quote
Old 05-04-2009, 10:51 PM   PM User | #2
Old Pedant
Supreme Master coder!

 
Old Pedant's Avatar
 
Join Date: Feb 2009
Posts: 23,210
Thanks: 59
Thanked 3,996 Times in 3,965 Posts
Old Pedant is a name known to allOld Pedant is a name known to allOld Pedant is a name known to allOld Pedant is a name known to allOld Pedant is a name known to allOld Pedant is a name known to all
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?
Old Pedant is offline   Reply With Quote
Old 05-04-2009, 11:13 PM   PM User | #3
Jablesdactyl
New to the CF scene

 
Join Date: May 2009
Posts: 5
Thanks: 1
Thanked 0 Times in 0 Posts
Jablesdactyl is an unknown quantity at this point
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?
Jablesdactyl is offline   Reply With Quote
Old 05-05-2009, 01:29 AM   PM User | #4
Old Pedant
Supreme Master coder!

 
Old Pedant's Avatar
 
Join Date: Feb 2009
Posts: 23,210
Thanks: 59
Thanked 3,996 Times in 3,965 Posts
Old Pedant is a name known to allOld Pedant is a name known to allOld Pedant is a name known to allOld Pedant is a name known to allOld Pedant is a name known to allOld Pedant is a name known to all
Sent you a private message. Look for it.
Old Pedant is offline   Reply With Quote
Reply

Bookmarks

Tags
coordinates, freelance, javascript

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 07:04 PM.


Advertisement
Log in to turn off these ads.