上一个按钮在jQuery中不起作用 [英] previous button is not working in jquery
本文介绍了上一个按钮在jQuery中不起作用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在将此代码用于jquery滑块
jquery
Hi i am using this code for jquery slider
jquery
<script type="text/javascript">
$(document).ready(function(){
$("#navleft").click(function() {
$("#slideshow > div:gt(0)").hide();
$('#slideshow > div:first').fadeOut(3000).prev().fadeIn(3000).end().appendTo('#slideshow');
});
$("#navright").click(function() {
$("#slideshow > div:gt(0)").hide();
$('#slideshow > div:first').fadeOut(3000).next().fadeIn(3000).end().appendTo('#slideshow');
});
});
</script>
HTML代码
HTML code
<input id="navleft" type="button" value="<<"/>
<div id="slideshow">
<div>
<img src="image1">
</div>
<div>
<img src="image2">
</div>
<div>
<img src="image3">
</div>
<div>
<img src="image4">
</div>
<div>
<img src="image5">
</div>
</div>
<input id="navright" type="button" value=">>"/>
如果我单击下一个按钮,则可以正常工作,但上一个按钮不起作用...
请帮助我...
If i click the next button its works fine but previous button is not working...
plz help me...
推荐答案
(文档).ready(
(document).ready(function(){
( #navleft ").click(
("#navleft").click(function() {
( #slideshow> div:gt(0)").hide();
("#slideshow > div:gt(0)").hide();
这篇关于上一个按钮在jQuery中不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文