In Twitter Bootstrap, how do I unbind an event from the closing of a modal dialog?

前端 未结 2 949
轻奢々
轻奢々 2021-02-07 03:22

I have a function that is bound to the action of hiding a modal dialog.

I\'m using code similar to the accepted answer to this question.

$(\'#myModal\')         


        
2条回答
  •  夕颜
    夕颜 (楼主)
    2021-02-07 03:33

    Use:

    $('#myModal').off('hidden');
    

    Why not unbind?

    As of jQuery 3.0, .unbind() has been deprecated. It was superseded by the .off() method since jQuery 1.7, so its use was already discouraged.

    Source: jQuery API.

提交回复
热议问题