onclick gets fired even when double clicked

S

spinybabler

Hi,

Here is my problem: I have a image map. When i click an area on the
image map, the area is to be highlighted. This highlighting i achieve
by drawing a div over the image area. I have both click and double
click events defined for an image area. But when i double click on
the
area, first onclick gets called which results in a div layer drawn
above the image area and thus double click event never gets called.
Is
there any workaround to fix this?

Any help would be highly appreciated.

Thanks a lot.
 
T

Thomas 'PointedEars' Lahn

spinybabler said:
Here is my problem: I have a image map. When i click an area on the image
map, the area is to be highlighted. This highlighting i achieve by
drawing a div over the image area. I have both click and double click
events defined for an image area. But when i double click on the area,
first onclick gets called which results in a div layer drawn above the
image area and thus double click event never gets called. Is there any
workaround to fix this?

This should not happen. Maybe you are not double-clicking quickly enough?

While you could draw the `div' element onmouseover and use its 'click' and
(proprietary) `dblclick' events, or you could use event delegation, this
does not avoid the accessibility issue. Although slower, and harder to
maintain, you should probably exchange the whole image on `click' instead of
drawing the `div'.


PointedEars
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,768
Messages
2,569,574
Members
45,051
Latest member
CarleyMcCr

Latest Threads

Top