变量未在 JavaScript 中求值?
谁能告诉我怎么做?它们已经是整数了,所以我不知道该尝试什么......
var lrgSlideShow = {
activeClass: 'active',
wrapperClass: 'slideshow-widget-large',
pauseLength: 2000,
fadeLength: 1000
}
setInterval(changeImg,lrgSlideShow.pauseLength+lrgSlideShow.fadeLength);
Can anyone tell me how do this? They are already integers, so I'm not sure what to try...
var lrgSlideShow = {
activeClass: 'active',
wrapperClass: 'slideshow-widget-large',
pauseLength: 2000,
fadeLength: 1000
}
setInterval(changeImg,lrgSlideShow.pauseLength+lrgSlideShow.fadeLength);
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
间隔计算(lrgSlideShow.pauseLength+lrgSlideShow.fadeLength)是正确的。
也许changeImg没有按预期调用?
另一个想法:var 声明和 setInterval 调用共享相同的功能范围吗?如果没有那么setInterval可能无法找到lrgSlideShow或者找错了
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