Activate Draggable onmousedown
Hello,
I am using jquery ui in one of my web applications and would like to
activate dragging only when the user basically is going to drag an
item - in other words, when the user hits the mousedown on the
dragging element.
I tried something like this:
<div id="item" onmousedown="activateDrag();">
I can be dragged
</div>
the script:
....
var isDraggingEnabled = false;
function activateDrag()
{
//if (!isDraggingEnabled)
//{
$("#item").draggable(helper: 'clone');
isDraggingEnabled = false;
//}
}
Now this does not work the first time. However the second time I try
the drag the element it suddenly works. I assume that on the first
call it enables the dragging, but doesnt really drag the item. How can
I make it drag?
Thanks