调用jquery jCarousel的next和prev函数?

我使用jCarousel创建滚动内容(请点击此http://sorgalla.com/projects/jcarousel/ )。 但是我不想使用默认的下一个和上一个按钮,所以我想创建2个按钮来处理click事件。 EX:我有2个这样的超链接:

 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 });  NEXT PREV 

如何将next和prev函数绑定到上面的链接?

看看这个例子:

http://sorgalla.com/projects/jcarousel/examples/static_controls.html

基本上,您可以在轮播初始化中将function附加到轮播。 这是相关的片段。

 function mycarousel_initCallback(carousel) { jQuery('#mycarousel-next').bind('click', function() { carousel.next(); return false; }); jQuery('#mycarousel-prev').bind('click', function() { carousel.prev(); return false; }); }; 

你也可以这样做

 `$('.jcarousel-next').click(function() { $('.jcarousel').jcarousel('scroll', '+=1'); });` 

以下是更多信息: http : //sorgalla.com/jcarousel/docs/reference/usage.html

jQuery的:

 jQuery(function ($) { $(".jcarousellite-hr").jCarouselLite({ vertical: false, hoverPause: true, visible: 4, auto: 3000, speed: 1000, btnNext: ".next", btnPrev: ".prev" }); }); 

HTML:

   

$( ‘的jCarousel-下纵’)点击()。