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

前端 未结 2 710
盖世英雄少女心
盖世英雄少女心 2021-01-18 09:25
$(\'#element\').draggable ({
    stop: function () {
        alert (\'stopped\');
        //do some action here
    }
}).trigger(\'stop\');

nothing

2条回答
  •  粉色の甜心
    2021-01-18 10:00

    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.

提交回复
热议问题