jQuery click events firing multiple times

后端 未结 25 2800
不知归路
不知归路 2020-11-22 11:01

I\'m attempting to write a video poker game in Javascript as a way of getting the basics of it down, and I\'ve run into a problem where the jQuery click event handlers are f

25条回答
  •  陌清茗
    陌清茗 (楼主)
    2020-11-22 11:51

    Unbind () works, but that might cause other issues in the future. The handler triggers multiple times when it is inside another handler, so keep your handler outside and if you want the values of the handler which had nested, assign them to a global variable that it will be accessible to the your handler.

提交回复
热议问题