jQuery禁用“下一步"按钮,直到动画结束 [英] Jquery Disable Next button until animation finishes
本文介绍了jQuery禁用“下一步"按钮,直到动画结束的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
这很酷,我对此很熟悉.但是我希望下一个和上一个按钮保持可见,只是不能单击.在我的特定情况下,按钮是设计中的图像.我只希望用户在动画结束之前无法单击.
This is cool and I am familiar with this. However I want the next and previous buttons to stay visible, just not be click able. In my particular situation, the buttons are images that are part of the design. I just want the user to not be able to click through before an animation ends.
推荐答案
$(function(){
$("#previous").bind("click", Previous);
$("#next").bind("click", Next);
});
function DoAnimation() {
$("#previous,#next").unbind("click");
$('#id').animate(
complete: function() {
$(this).after('<div>Animation complete.</div>');
$("#previous").bind("click", Previous);
$("#next").bind("click", Next);
}
});
}
function Previous() { }
function Next() { }
这篇关于jQuery禁用“下一步"按钮,直到动画结束的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文