shown.bs.modal fires multiple times when you close and reopen modal

后端 未结 7 516
囚心锁ツ
囚心锁ツ 2020-12-29 08:07

I have made a fiddle illustrating the issue I am facing at the moment. So every time I close and open a modal, shown.bs.modal also fires multiple times. In this

7条回答
  •  执念已碎
    2020-12-29 08:36

    That's because your are attaching several event handlers for the event, at first click you are listening once, on the second click twice and so on, listen to the event outside the context of openTestModal function.

提交回复
热议问题