Variable not evaluating in JavaScript?
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
精彩评论