我使用jCarousel来创建滚动内容(按照http://sorgalla.com/projects/jcarousel/)。但是,我不想使用默认的下一个和上一个按钮,所以我想创建两个按钮来处理点击事件。例如:我有两个这样的超链接:
<script>
jQuery(document).ready(function() {
// Initialise the first and second carousel by class selector.
// Note that they use both the same configuration options (none in this case).
jQuery('#scrollArea').jcarousel({
scroll: 10
});
</script>
<a>NEXT</a>
<a>PREV</a>
<div id="scrollArea">
<!-- CONTENT HERE -->
</div>
如何将next和prev函数绑定到上面的链接?
4条答案
按热度按时间aydmsdu91#
看看这个例子:
http://sorgalla.com/projects/jcarousel/examples/static_controls.html
基本上,您可以在carousel的初始化中将函数附加到carousel。以下是相关的片段。
laawzig22#
你也可以做
以下是更多信息:http://sorgalla.com/jcarousel/docs/reference/usage.html
iyfjxgzm3#
jQuery:
联系我们
oknwwptz4#
$('. jcarousel-next-vertical ').click();