jquery 循环内容,带有上一个和下一个按钮
我的网站有一个 jquery 循环脚本,可以不断循环浏览我们公司的新内容。不对,我将过渡设置为scrollLeft。我想添加一个上一个和下一个按钮,该按钮将在上一个上向右滚动,在下一个上向左滚动。我找不到任何论坛可以满足我的需求。这是我的代码。
$('#slider').cycle({
// choose your transition type, ex: fade, scrollUp, shuffle, etc...
fx: 'scrollLeft',
delay: -100,
prev: '#prev',
next: '#next',
})
感谢您的帮助。
I have a jquery cycle script for my website to continually cycle through content on what's new within our company. Right not I have the transition set to scrollLeft. I would like to add a prev and next button that would scrollRight on prev and scrollLeft on next. I couldn't find any forums that would do quite what I'm looking for. Here is my code.
$('#slider').cycle({
// choose your transition type, ex: fade, scrollUp, shuffle, etc...
fx: 'scrollLeft',
delay: -100,
prev: '#prev',
next: '#next',
})
Thanks for the help.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
要获得导航,您只需创建 ID 为
prev
和next
的“prev”和“next”按钮。要实现反向滚动,您需要将滚动设置为
scrollHorz
,然后将rev
选项(反向)设置为 1。请参阅此处:http://jsfiddle.net/mstauffer/g9b7k/To get the navigation, you just need to create "prev" and "next" buttons with the IDs of
prev
andnext
.To get the reverse scrolling, you'll want to set your scroll to be
scrollHorz
and then set therev
option (reverse) to 1. See here: http://jsfiddle.net/mstauffer/g9b7k/