$('#fantasy_login_img').click(function () {
$('#unamelogin').focusin();
$('#fblogin').toggle('slow').animate(1000);
$('#gplogin').toggle('slow').animate(1000);
$('#fantasyLogin').toggle('slow').animate(1000);
});
我有这段代码,当我顺利按下它时,它工作正常,但是当我快速单击它很多次时,它停止工作。
可能是什么原因?
最佳答案
尝试在每次切换之前添加 .stop() ,如下所示
$('#fantasy_login_img').click(function () {
$('#unamelogin').focusin();
$('#fblogin').stop().toggle('slow').animate(1000);
$('#gplogin').stop().toggle('slow').animate(1000);
$('#fantasyLogin').stop().toggle('slow').animate(1000);
});
关于jquery - 为什么标签的切换不起作用?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29763940/