目前,我有這個,但它一直返回「swapBKgnd是沒有定義」:jQuery如何正確設置間隔?
var interval = self.setInterval("swapBKgnd()", 9000);
function swapBKgnd() {
(direction === 'next') ? ++current : --current;
if (current === 0) {
current = imgsLenth;
direction = 'next';
} else if (current - 1 === imgsLenth) {
current = 1;
loc = 0;
}
transition(sliderUL, loc, direction);
};
感謝。
嘗試function' :) –
變種的時間間隔後'申報'VAR interval' =的setInterval( swapBKgnd,9000); –
刪除'swapBKgnd()'中的引號。 – karthikr