html5 - Jquery draggable object start and stop events is not getting triggered -
pfb code. here able trigger stop event using below code.
$(function () { $("#drag").draggable({ stop: function (event, ui) { var = "avinash"; } }); }); }
but using below code not able trigger stop event.
$(function () { $("#drag").draggable({ stop: this.handledragstop }); }); function handledragstop(event, ui) { debugger; } }
i did not understood missing here.
please me on this.
firstly, have additional incorrect bracket in second approach. secondly, approach doesn't work you, because you're using immediate function, creates new scope , 'this' not related "handledragstop" scope (in case it's global scope). should move handledragstop function inside immediate function, or use handledragstop without 'this'.
Comments
Post a Comment