开发者

Variable not evaluating in JavaScript?

开发者 https://www.devze.com 2022-12-25 00:18 出处:网络
Can anyone tell me how do this? They are already integers, so I\'m not sure what to tr开发者_JAVA技巧y...

Can anyone tell me how do this? They are already integers, so I'm not sure what to tr开发者_JAVA技巧y...

var lrgSlideShow = {
    activeClass: 'active',
    wrapperClass: 'slideshow-widget-large',
    pauseLength: 2000,
    fadeLength: 1000
}

setInterval(changeImg,lrgSlideShow.pauseLength+lrgSlideShow.fadeLength);


The interval calc (lrgSlideShow.pauseLength+lrgSlideShow.fadeLength) is correct. Maybe changeImg is not invoking as expected?

Another thought: Do the var declaration and the setInterval invocation share the same functional scope? If not then setInterval may be unable to find lrgSlideShow or finding the wrong one

0

精彩评论

暂无评论...
验证码 换一张
取 消