我使用這段代碼tutorialzine:推進幻燈片jQuery中
$(window).load(function(){
// The window.load event guarantees that all the images are loaded before the auto-advance begins.
var timeOut = null;
$('#slider_navigator .arrow, #slider_navigator .dot').click(function(e,simulated){
// The simulated parameter is set by the trigger method.
if(!simulated){
// A real click occured. Cancel the auto advance animation.
clearTimeout(timeOut);
}
});
// A self executing named function expression:
(function autoAdvance(){
// Simulating a click on the next arrow.
timeOut = setTimeout(autoAdvance,2000);
$('.slider_rightlink').trigger('click',[true]);
})();
});
這就像預期的,除了一兩件事,當我加載頁面的第一張幻燈片立即先進。加載後,它與其他幻燈片很好地旋轉。
我該如何改變它,使其顯示第一張幻燈片2秒鐘?
有時生命是如此複雜。謝謝! – klaaz
沒問題。讓我知道它是否成功:D – mowwwalker