views:

13

answers:

1

Hi,

I have a draggable image within a div. I can click on the image to bring up a pop-up menu, which works fine. Quite often when I click on the image I drag it by about 1-5 pixels, therefore on click event doesn't get fired up, instead, a dragstart event gets fired up, so the pop-up menu doesn't appear on the screen.

Is there a way to stop minor dragging events from firing up? I.e. any drag event below 5 pixels in either X or Y axis will be ignored, and everything above 5 pixels in either X or Y axis will fire up a dragging event.

Thank you

+1  A: 

If you are using jQueryUI, take a look at the following demo: http://jqueryui.com/demos/draggable/#delay-start

elusive
Exactly what I'm after. Thank you
vikp
I guess the only disadvantage here is that I'll be introducing an additional plugin, which isn't always a good thing.
vikp
Thats right. I assumed that you were already using jQueryUI.
elusive