有用!!! http://jsfiddle.net/jupago/W6CkP/
基于此线程:暂停 Nivo 滑块
我能够让它停在第一张图片上。
这是我的代码。我要停止动画两次,因为我希望它在幻灯片结束后也停止:
$(window).load(function() {
$('#slider').nivoSlider({
effect: 'fade', // Specify sets like: 'fold,fade,sliceDown'
animSpeed: 500, // Slide transition speed
pauseTime: 5000,
startSlide: 0, // Set starting Slide (0 index)
directionNav: true, // Next & Prev navigation
controlNav: false, // 1,2,3... navigation
controlNavThumbs: false, // Use thumbnails for Control Nav
pauseOnHover: false, // Stop animation while hovering
manualAdvance: false, // Force manual transitions
prevText: 'previous', // Prev directionNav text
nextText: 'next', // Next directionNav text
randomStart: false, // Start on a random slide
slideshowEnd: function(){
$('#slider').data('nivoslider').stop();
setTimeout("$('#slider').data('nivoslider').start()",10000);
}, // Triggers when last slide is shown
});
$('#slider').data('nivoslider').stop();
setTimeout("$('#slider').data('nivoslider').start()",10000);
});
原帖在这里:
我正在使用 NIVO 滑块插件,虽然我让它工作顺利,但我需要第一张图像比其他图像持续更长时间(第一张图像中有文本)。
我在这里创建了一个工作小提琴:jsfiddle.net/jupago/W6CkP
这应该可以更容易地理解这个问题。我仍然附上小提琴之前的html代码以供参考:
HTML:
<div class="slider-wrapper">
<div id="slider" class="nivoSlider">
<img src="http://goo.gl/I4c65" />
<img src="http://goo.gl/acxBF"/>
<img src="http://goo.gl/GBzYF"/>
<img src="http://goo.gl/BC2EA" />
<img src="http://goo.gl/9Sd69" />
<img src="http://goo.gl/qOaZl"/>
<img src="http://goo.gl/btswq" />
</div>
</div>
JS 尼沃:
$('#slider').nivoSlider({
effect: 'fade', // Specify sets like: 'fold,fade,sliceDown'
animSpeed: 500, // Slide transition speed
pauseTime: 5000, // How long each slide will show
startSlide: 0, // Set starting Slide (0 index)
directionNav: true, // Next & Prev navigation
controlNav: false, // 1,2,3... navigation
controlNavThumbs: false, // Use thumbnails for Control Nav
pauseOnHover: false, // Stop animation while hovering
manualAdvance: false, // Force manual transitions
prevText: 'next', // Prev directionNav text
nextText: 'previous;', // Next directionNav text
randomStart: false, // Start on a random slide
beforeChange: function(){}, // Triggers before a slide transition
afterChange: function(){}, // Triggers after a slide transition
slideshowEnd: function(){}, // Triggers after all slides have been shown
lastSlide: function(){}, // Triggers when last slide is shown
afterLoad: function(){} // Triggers when slider has loaded
});