0

目前我有这个,但它一直返回“swapBKgnd is no defined”:

    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);
};

谢谢。

4

1 回答 1

0

从 中删除引号swapBKgnd()

使用可以做:

var interval = self.setInterval(swapBKgnd, 9000);

你还没有声明directioncurrent或者loc-那些会抛出错误

于 2013-04-16T17:03:44.917 回答