我使用JQuery任何滑块/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>
附加信息…这是我的任意滑动条选项。
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
});
});
你看过这个演示吗?基本上就是将infiniteSlides
选项设置为false
,将stopAtEnd
选项设置为true
$('#slider').anythingSlider({
infiniteSlides: false,
stopAtEnd: true
});