jQuery UI Draggable 'stop' event called too many times?

Posted by Graham on Stack Overflow See other posts from Stack Overflow or by Graham
Published on 2010-06-17T16:11:27Z Indexed on 2010/06/17 16:13 UTC
Read the original article Hit count: 222

Filed under:
|
|

I have a feeling I'm either misunderstanding the 'stop' event or not doing it right, but it seems to be called several times while the element is bound to is being dragged.

makeAllDragable = function () {
    $(".test-table").draggable({
        start: function (event, ui) { $(this).click(); },
        stop: function (event, ui) { foo() }
    }).click(function () {
        selectTable($(this));
    });
}

foo = function () {
    alert("test");
}

In this example foo is called about 30 times, shouldn't is just be when I release the draggable? The jQuery docs don't actually say one where or another though.

© Stack Overflow or respective owner

Related posts about JavaScript

Related posts about jQuery