這裏真的很簡單,我敢肯定 - 我是一個初學者,他努力將setInterval集成到我的jQuery中。我目前有這個功能,點擊它們可以旋轉兩個圖像。我希望這會自動發生(每隔幾秒鐘),並且似乎無法找到使用setInterval的正確方法。使用setInvernal每隔幾秒調用一次查詢函數?
任何人都可以指向正確的方向嗎?非常感謝您的幫助。
菲利普
$(document).ready(function(){
$("#spinitemholder1 .sponsorFlipphil1 img").click(function() {
$(this).animate({ "width": "0px", "margin-left": "135px" }, 500, function() {
$(this).parent().hide();
$(this).width(0);
$("#spinitemholder1 .sponsorFlipphil2 img").animate({ "width": "271px", "margin-left": "0px" });
$("#spinitemholder1 .sponsorFlipphil2").show();
});
});
$("#spinitemholder2 .sponsorFlipphil2 img").click(function() {
$(this).animate({ "width": "0px", "margin-left": "135px" }, 500, function() {
$(this).parent().hide();
$(this).width(0);
$("#spinitemholder1 .sponsorFlipphil1 img").animate({ "width": "271px", "margin-left": "0px" });
$("#spinitemholder1 .sponsorFlipphil1").show();
});
});
});
它沒有'setInterval'工作嗎?因爲這裏有一個語法錯誤:''#spinitemholder .sponsorFlipphil1 img「 –
2011-04-06 09:15:33
我想你在代碼中留下了一段XSLT。如果對手頭的問題無關緊要,可否請刪除它? – 2011-04-06 09:16:50
是什麼問題?你爲什麼認爲這是'setInterval'的錯? – 2011-04-06 09:17:03