我有以下jquery幻灯片代码可以很好地工作:
<script type="text/javascript">
$('#slideshow').cycle({
fx: 'fade',
speed: 1000,
timeout: 5000
});
</script>
我想知道是否以及如何使用jquery循环选项将Prev和Next按钮添加到幻灯片中?我看到了prev:& next:选项,但是它们到底是如何编码的呢?
发布于 2014-01-01 01:10:44
您提供的代码只是调用jQuery周期插件。
因此,您需要在该plugin reference page中找到不同的插件选项
上一个和下一个的代码是写成here的
if (opts.next)
$(opts.next).bind(opts.prevNextEvent,function(){return advance(opts,1);});
if (opts.prev)
$(opts.prev).bind(opts.prevNextEvent,function(){return advance(opts,0);});
发布于 2014-01-01 02:45:06
尝试像这样添加按钮
<a id="prev" href="#">Prev</a>
<a id="next" href="#">Next</a>
$('#slideshow').cycle({
fx: 'fade',
speed: 1000,
timeout: 5000,
prev: '#prev', //id of buttons
next: '#next',
});
演示http://jsfiddle.net/LvBRA/1/
https://stackoverflow.com/questions/20860633
复制相似问题