2012-01-18 67 views
0

我無法讓Jquery Cycle插件工作。我的代碼如下。發生了什麼是Next按鈕順序通過幻燈片,但是當我按前一個按鈕時,它將從該序列中的最後一個圖像開始。我不希望它自動播放,這就是爲什麼我的document.ready函數我稱之爲暫停命令。Jquery Cycle插件。命令上一個不能正常工作

任何幫助將不勝感激。

薩姆

<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.5/jquery.min.js"></script> 
<!-- include Cycle plugin --> 
<script type="text/javascript" src="http://cloud.github.com/downloads/malsup/cycle/jquery.cycle.all.latest.js"></script> 


<script type="text/javascript"> 
    $(document).ready(function() { 

     $('.main').cycle({ 
      fx : 'fade' // choose your transition type, ex: fade, scrollUp, shuffle, etc... 
     }); 

     $(".main").cycle("pause"); 

    }); 

</script> 

// extra page code not shown // 


    <div class="main" id="main"> 
     <img src="../images/design/beautiful1.jpg" height=600 width=500> 
     <img src="../images/design/beautiful2.jpg" height=600 width=500> 
     <img src="../images/design/beautiful3.jpg" height=600 width=500> 
     <img src="../images/design/beautiful4.jpg" height=600 width=500> 

    </div> 


</body> 

<div class="label" id="nextbutton"><img src="../images/nextarrow.jpg"></div> 
<div class="label" id="prevbutton"><img src="../images/prevarrow.jpg"></div> 

<script> 

     $("#nextbutton").live("click",function(){ 

       $(".main").cycle("next"); 

     } 


    ); 

     $("#prevbutton").live("click",function(){ 

       $(".main").cycle("prev"); 

     } 


    ); 

</script> 

回答