我正在使用 jQUery FlexSlider 以下是我的代码
<link rel="stylesheet" type="text/css" href="css/gallery/shCore.css" />
<link rel="stylesheet" type="text/css" href="css/gallery/shThemeDefault.css" />
<link rel="stylesheet" type="text/css" href="css/gallery/flexslider.css" />
<script type="text/javascript" src="js/gallery/modernizr.js"></script>
<script type="text/javascript" src="js/gallery/jquery.flexslider.js" ></script>
<script type="text/javascript" src="js/gallery/shCore.js"></script>
<script type="text/javascript" src="js/gallery/shBrushXml.js"></script>
<script type="text/javascript" src="js/gallery/shBrushJScript.js"></script>
<script type="text/javascript" src="js/gallery/jquery.easing.js"></script>
<script type="text/javascript" src="js/gallery/jquery.mousewheel.js"></script>
和下面的 isin 身体
<body>
<div id="slider" class="flexslider">
<ul class="slides">
<li >
<img src="images/gallery/1.jpg" alt="image01" data-description="Fiesta Gallery" height="299px" width="450px" />
</li>
<li >
<img src="images/gallery/2.jpg" alt="image01" data-description="Fiesta Gallery" height="299px" width="450px"/>
</li>
<li >
<img src="images/gallery/3.jpg" alt="image01" data-description="Fiesta Gallery" height="299px" width="450px" />
</li>
<li >
<img src="images/gallery/4.jpg" alt="image01" data-description="Fiesta Gallery" height="299px" width="450px" />
</li>
<li >
<img src="images/gallery/5.jpg" alt="image01" data-description="Fiesta Gallery" height="299px" width="450px" />
</li>
<li >
<img src="images/gallery/6.jpg" alt="image93" data-description="Fiesta Gallery" height="299px" width="450px" />
</li>
<li >
<img src="images/gallery/7.jpg" alt="image97" data-description="Fiesta Gallery" height="299px" width="450px" />
</li>
<li >
<img src="images/gallery/8.jpg" alt="image108" data-description="Fiesta Gallery" height="299px" width="450px" />
</li>
</ul>
</div>
<div id="carousel" class="flexslider" style="margin-top:-50px;">
<ul class="slides">
<li >
<img src="images/gallery/thumbs/1.jpg" height="100px" />
</li>
<li >
<img src="images/gallery/thumbs/2.jpg" height="100px" />
</li>
<li >
<img src="images/gallery/thumbs/3.jpg" height="100px" />
</li>
<li >
<img src="images/gallery/thumbs/4.jpg" height="100px" />
</li>
<li >
<img src="images/gallery/thumbs/5.jpg" height="100px" />
</li>
<li >
<img src="images/gallery/thumbs/6.jpg" height="100px" />
</li>
<li >
<img src="images/gallery/thumbs/7.jpg" height="100px" />
</li>
<li >
<img src="images/gallery/thumbs/8.jpg" height="100px" />
</li>
</ul>
</div>
</body>
以下是head部分的配置
$(function(){
SyntaxHighlighter.all();
});
$(window).load(function() {
// The slider being synced must be initialized first
$('#carousel').flexslider({
animation: "slide",
controlNav: false,
animationLoop: true,
directionNav: false,
slideshow: false,
slideshowSpeed: 7500,
animationSpeed: 400,
itemWidth: 150,
itemMargin: 5,
startAt: 0,
move : 3,
asNavFor: '#slider'
});
$('#slider').flexslider({
animation: "slide",
controlNav: false,
animationLoop: true,
slideshowSpeed: 7500,
animationSpeed: 400,
pauseOnAction: false,
slideshow: true,
startAt: 0,
sync: "#carousel",
start: function(slider) {
$('#carousel .slides li img').click(function(event){
event.preventDefault();
//slider.flexAnimate(slider.getTarget("next"));
var count = slider.currentSlide + 1;
slider.flexAnimate(count);
});
}
});
});
从上面的代码中,我可以进行自动滑动、左/右按钮导航,并且在一些缩略图中单击它可以工作。
但是如果我点击当前缩略图后面的两个缩略图,它会停止自动滑动。
我怎样才能解决这个问题?任何帮助将不胜感激。
提前感谢!!