views:

366

answers:

1

For a project I'm working on, the user needs to enter a direction, like "north" (ie N), NE and so forth. It'd be nice to have a little compass on the webpage that the user could click on various points on the compass and it would represent the appropriate direction.

Is there some existing javascript html snippet that does this?

+3  A: 

Probably faster and easier to get an image of a compass and put an imagemap on it. This concept could even work without JS if you tile 8 images using:

<input type="image">

Even better absolutely position radio select buttons over the compass points of a background image. Then you don't have to submit immediately.

SpliFF
You could even add onclick handlers to each of the mapped images to call any JavaScript that you need.
ajm
Yeah I couldn't find an existing compass widget, so I'm making my own with image maps.
Rory
Did you make one Rory? Wanna share it? :)
Mr. Flibble