I'm trying to stop a transition with an action(in this case on hover), but i don't know how to achieve it. This is where i'm making the test:
I have 3 instances of jcarousel
and my goal is to stop the movement(immediately) on mouseover.
The problem is: when the mouse is over the carousel, i stop it, but the current transition is ended before the stop, and the sensation is not the desired, i wish to stop the movement immediately on mouseover.
This is the initialization for the first carousel:
$('#jcarousel1')
.jcarousel({
'animation': {
'duration': 6000, //DEFINE SPEED
'easing': 'linear',
'complete': function() {
//ON ANIMATION COMPLETE ACTION GO HERE
}
},
'wrap': 'circular'
}).jcarouselAutoscroll({
interval: 1,
target: '+=1',
autostart: true
}).on('mouseover',function(e){
$(this).jcarouselAutoscroll('stop');
}).on('mouseout',function(e){
$(this).jcarouselAutoscroll('start');
});
The others two instances of jcarousel are similar initialized.
UPDATE: I already tried:
$('#jcarousel1').jcarousel('list').stop();
This stops the movement (scrolling) but i'm not able to start the movement again on mouse out in the same position it was before.
UPDATE 1: I also tried on mouseout (and make it work again)
$('#jcarousel1').jcarousel('destroy')
$('#jcarousel1').jcarousel( arrayWithInitOptions )
but this has an undesired effect because start the movement from the beginning of the carousel(a reload), from the first item, and i want to restart from the same position it was on mouseover.
You may use something like this