2

I am trying to trigger on drag event using jQuery.

Please find the fiddle here http://jsfiddle.net/sgsvenkatesh/hepbob75/5/

I used this to trigger on drag event but it is not working.

$(document).bind("mousedown", function () { ... });

This is acting like a on click event rather than a on drag event. The same code is working absolutely fine when I use mousemove instead of mousedown like

$(document).bind("mousemove", function () { ... });

Is there a way to work on drag event? Or is there any other function which trigger on drag event?

Please let me know if any further information is necessary.

kvn
  • 2,210
  • 5
  • 20
  • 47

1 Answers1

1

You'll need to remember where the mouse was clicked and check mouseup to determine if it's a drag. See this answer https://stackoverflow.com/a/4139860/1620112.

Community
  • 1
  • 1
Charlie Dalsass
  • 1,986
  • 18
  • 23