Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Jquery ui, call start drag manually

In Jquery UI I can configure an element as draggable by invoking

$("#drag").draggable();

But is there a way to start and stop the drag functions manually from another function? Ie

someOtherFunction = function() {
  $("#drag").startdrag();
}
yetAnotherFunction = function() {
  $("#drag").stopdrag();
}
like image 913
Jan Avatar asked Apr 08 '09 14:04

Jan


1 Answers

Answers above seem overcomplicated.

$('.nonDraggableObjectWhichTriggersDrag').mousedown(function(e) {
    $('.draggableObject').trigger(e); 
});
like image 58
John Milmine Avatar answered Sep 30 '22 02:09

John Milmine