我无法使Jquery Cycle插件正常工作。我的代码如下。发生的事情是“下一步”按钮顺序通过幻灯片,但是当我按下前一个按钮时,它会从序列中的最后一个图像开始。我不希望它自动播放这就是为什么我的document.ready函数我调用pause命令。
任何帮助将不胜感激。
萨姆
<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>