我正在使用JQuery Anything Slider / PHP / MySQL。在我的代码中,一切都按预期工作。但是,如果您要显示第一组缩略图,我想禁用缩略图轮播的后退箭头。如果您正在显示图像集中的最后一组缩略图,我还想禁用转发。换句话说,我想阻止缩略图轮播无限循环。任何帮助将不胜感激。这是我的代码。
<div class="anythingSlider">
<div class="thumb_wrapper">
<ul style="list-style-type: none;">
<?php
$new = 1;
$count = 0;
do {
if ($new == 1)
{echo '<li style="list-style-type: none;">';} ?> <div class="thumb" data-count="<?php echo $count; ?>" data-thumb="<?php echo $image_row['thumb']; ?>" ><img title="<?php echo $image_row['description']; ?>" data-image="<?php echo $image_row['image']; ?>" src="<?php echo $image_row['thumb']; ?>" alt="<?php echo $image_row['description']; ?>" /></div>
<?php $count++;
if ($new == 5)
{ echo "</li>"; $new = 1;
} else {
$new ++;}
}
while ($image_row = mysql_fetch_array($image)); ?>
</ul>
</div>
</div>
其他信息......以下是我的Anything Slider选项。
function formatText(index, panel) {
return index + "";
};
$(function () {
$('.anythingSlider').anythingSlider({
easing: "easeInOutExpo",
autoPlay: false,
delay: 3000,
startStopped: false,
animationTime: 600,
hashTags: true,
buildNavigation: true,
pauseOnHover: true,
startText: "Go",
stopText: "Stop",
navigationFormatter: formatText
});
});
答案 0 :(得分:1)
您看到this demo了吗?基本上只需将infiniteSlides
选项设置为false
,将stopAtEnd
设置为true
$('#slider').anythingSlider({
infiniteSlides: false,
stopAtEnd: true
});