0

I need to start scroll when user hover. I take a function reference from the question this and this. I notice that even the callback function is not working with initCallback option. Am I missing something or I forgot something to put in the code. Here is example of code fiddle

function mycarousel_initCallback(carousel)
{
  carousel.clip.hover(function() {
    carousel.startAuto();
  }, function() {
    carousel.stopAuto();
    });
};
Community
  • 1
  • 1
Jitender
  • 7,593
  • 30
  • 104
  • 210

1 Answers1

1

You should use jcarouselAutoscroll plugin for that

Check this updated fiddle

INIT CODE

A(".example").jcarousel({
    auto: 1,
    wrap: "last"
}).jcarouselAutoscroll({
    interval: 1000,
    target: '+=1',
    autostart: false
});

Code for hovering

$(".example li").hover(function () {
    $(".example").jcarouselAutoscroll('start');
},function () {
    $(".example").jcarouselAutoscroll('stop');
})
Cerlin
  • 6,622
  • 1
  • 20
  • 28