我有一些问题,与此代码,当我点击开始按钮,一切工作正常,但是当我想clearInterval
停止动画它不工作,只是不断循环...什么我做错了吗?clearInterval不起作用?
var a = function() {
$("div").animate({height:300},"slow");
$("div").animate({width:300},"slow");
$("div").animate({height:100},"slow");
$("div").animate({width:100},"slow");
}
$(document).ready(function(){
$("start").click(function(){
setInterval(a,1000);
});
$("stop").click(function(){
clearInterval(a);
});
});
只想说谢谢大家对这种迅速的回答!!!! –
@Dejo - 很高兴帮助你,请务必将其标记为答案。 – ShankarSangoli
$( “开始”)应和$( “#启动”)...不是它... – Wazzzy