Javascript SlideJS间隔函数不工作
使用SlideJs 这是我的测试滑块: 当下面的代码处于活动状态时,它不会移动到下一张幻灯片 当我取出预加载功能后,它会再次工作 我试着让两张幻灯片播放,滑块停在第二张幻灯片上(而不是循环) 有人能发现这个问题吗 谢谢大家!Javascript SlideJS间隔函数不工作,javascript,jquery,html,css,Javascript,Jquery,Html,Css,使用SlideJs 这是我的测试滑块: 当下面的代码处于活动状态时,它不会移动到下一张幻灯片 当我取出预加载功能后,它会再次工作 我试着让两张幻灯片播放,滑块停在第二张幻灯片上(而不是循环) 有人能发现这个问题吗 谢谢大家! <div id="slides"><img src="https://cdn.shopify.com/s/files/1/1090/4910/files/jetwell_org_srgb.gif" /> <img src="https://c
<div id="slides"><img src="https://cdn.shopify.com/s/files/1/1090/4910/files/jetwell_org_srgb.gif" /> <img src="https://cdn.shopify.com/s/files/1/1090/4910/files/stock-vector-flat-design-icons-air-holidays-background-261200120-_1.png" /></div>
<script src="//code.jquery.com/jquery-latest.min.js"></script><script src="https://cdn.shopify.com/s/files/1/1090/4910/files/jquery.slides.min.js"></script><script src="https://cdn.shopify.com/s/files/1/1090/4910/files/jquery.slides.js"></script><script>// <![CDATA[
$(function(){
$("#slides").slidesjs({
width: 700,
height: 400,
play: {
active: false,
// [boolean] Generate the play and stop buttons.
// You cannot use your own buttons. Sorry.
effect: "slide",
// [string] Can be either "slide" or "fade".
interval: 3000,
// [number] Time spent on each slide in milliseconds.
auto: true,
// [boolean] Start playing the slideshow on load.
swap: false,
// [boolean] show/hide stop and play buttons
pauseOnHover: false,
// [boolean] pause a playing slideshow on hover
restartDelay: 2500
// [number] restart delay on inactive slideshow
},
navigation: {
active: false,
// [boolean] Generates next and previous buttons.
// You can set to false and use your own buttons.
// User defined buttons must have the following:
// previous button: class="slidesjs-previous slidesjs-navigation"
// next button: class="slidesjs-next slidesjs-navigation"
effect: "slide"
// [string] Can be either "slide" or "fade".
},
preload: false,
preloadImage: 'https://cdn.shopify.com/s/files/1/1090/4910/files/jetwell_org_srgb.gif',
play: 7000,
pause: 7000,
auto: 2000,
generatePagination: false,
hoverPause: false,
animationComplete: function(current) {
var total = $("#slides img").length - 2;
if (current >= total) {
clearInterval($('#slides').data('interval'));
}
},
slidesLoaded: function() {
$('.caption').animate({
bottom:0
},200);
}
});
});
// ]]></script>
//=总数{
clearInterval($('#幻灯片')。数据('interval');
}
},
slidesloadded:function(){
$('.caption')。设置动画({
底部:0
},200);
}
});
});
// ]]>
适用于我的Chrome浏览器。将第一个加载到循环中。分别点击1张和2张切换的幻灯片。那是因为我在操纵它!!我尝试实现的结果是第一张幻灯片加载初始gif,然后在大约7秒后加载第二张幻灯片,然后滑块暂停/停止。