我有一些問題,與此代碼,當我點擊開始按鈕,一切工作正常,但是當我想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