gpt4 book ai didi

jQuery Mobile + Backbone 点击事件触发两次

转载 作者:行者123 更新时间:2023-12-01 00:11:08 24 4
gpt4 key购买 nike

这是我在 View 中定义事件的位置:

events : {
"tap #exerciseProgressBarContainer" : 'progressBarClick'
},

这是操作:

    progressBarClick : function() {
// start?
if(this.curWorkoutExercise.isTimed() && !this.curExerciseStartTime) {
HTMLHelper.endGlow(this.$('#exerciseProgressBarContainer .progressBar.overlay'));
this.startExerciseProgressTimer();
}
// done?
else {
this.stopExerciseProgressTimer();

// save the log
this.addCurExerciseLog();

this.startBreak();
this.nextAction();
}
},

基本上,在第一次点击时,用户启动进度计时器,启动后,再次点击即可完成它。我的 iPhone 和 Android 上发生的情况是点击事件触发两次,使进度条的开始和停止同时进行。有什么想法为什么会发生这种情况以及如何解决它吗?注意:我已经尝试过将 tapvclick 交换。

非常感谢!

最佳答案

我最终使用停止事件传播e.stopPropagation()e.preventDefault()

关于jQuery Mobile + Backbone 点击事件触发两次,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12113533/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com