2011-08-10 52 views
0

我正在使用JQuery Anything Slider/PHP/MySQL。在我的代碼中一切都按預期工作。但是,如果您要顯示第一組縮略圖,我想禁用縮略圖傳送帶的後退箭頭。如果您正在顯示來自圖像集的最後一組縮略圖,我還想禁用前進。換句話說,我想防止縮略圖傳送帶無限循環。任何幫助將不勝感激。這是我的代碼。Anything Slider防止無限縮略圖旋轉木馬循環

<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  
      }); 

}); 

回答

1

你看到this demo?基本上只是infiniteSlides選項falsestopAtEnd設置爲true

$('#slider').anythingSlider({ 
    infiniteSlides: false, 
    stopAtEnd: true 
});