Reputation: 7101
I used mouseup/down/move to manually implement jQuery.draggable functionality. Everything was working fine until I tried to move my div
inside a jQuery popup window.
After moving the div
dialogOpenMultiple("Title", "1234", "<div id=\"include\"></div>");
$('.autosize').appendTo('#include');
I faced two problems:
Firstly, the cursor is not moving bellow my mouse cursor because of some issue with offset and pageX, pageY.
While mousemove is working mouseup / drag / mousedown is not working because of the default browser's functionality which selects and tries to move the actual picture.
Please look the not working sample here:
Working sample:
Upvotes: 2
Views: 607
Reputation: 166
updated fiddle showing working draggable.
added e.preventDefault(); to mousedown function and changed the if (newdiv == null) to if (newdiv === null)
Upvotes: 1
Reputation: 5858
1) Easily fixed using cursor css. This will give a much better user experience. cursor:url(linkCursor.png), pointer;
2) You can stop browser default actions by adding e.preventDefault()
to your events.
Upvotes: 1