Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Jquery .trigger('stop') method for .draggable

$('#element').draggable ({
    stop: function () {
        alert ('stopped');
        //do some action here
    }
}).trigger('stop');

nothing happens, thought #element is draggable now and event does execute after drag is complete. I tried .triggerHandle as well as 'dragstop' as eventtype, no luck

like image 325
selytch Avatar asked Aug 28 '10 12:08

selytch


1 Answers

Use this to trigger it instead:

.trigger('dragstop')

If you want it to behave completely as a normal event, use .bind('dragstop', function) to attach it as well, the start option behaves slightly differently.

like image 186
Nick Craver Avatar answered Sep 30 '22 16:09

Nick Craver