New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Can't stop carousel in autoplay mode after 'to.owl.carousel' trigger #144
Comments
@sferrara Could you provide a link to an example? |
I'll just jump in here. I couldn't get the event above, or autoplay.stop.owl to work. Added to codepen. http://codepen.io/nford/pen/Jefcr |
@nford Thanks! |
@witrin Demo provided by you above doesn't seem to be working. Can you update? |
Have anyone found out a solution for this, can't make autoplay stop either. |
I tried this. Should work according to the Owl 2.0 docs. It never stops on hover, or autoplay.stop.owl $('.owl-carousel').owlCarousel({ $('.owl-item, .owl-prev, .owl-next, .owl-dot span').on('click',function(){ |
Now that OwlCarousel changed hand, maybe we will see a fix soon. Let's hope. |
Is there any more news on this? I've come across this issue now and would love for it to stop on request. Has any progress been made? |
I've taken a look at the code and it seems you're just missing one line of code. The autoplay handlers has this for the stop event: ...
'stop.owl.autoplay': $.proxy(function() {
this.stop();
}, this),
... Looking at the Autoplay.prototype.stop = function() {
window.clearInterval(this.interval);
}; This only clears the interval but doesn't stop the autoplay. Adding in a line to set the option fixes this: Autoplay.prototype.stop = function() {
window.clearInterval(this.interval);
this.core.settings.autoplay = false;
}; Note this may need a similar fix if you want to start autoplay as well but I haven't tested that. Hope this helps with the fix and helps anyone who needs this functionality. |
Thanks to @TcPhilBushnell. It works for me! |
Confirm @TcPhilBushnell works also for me. |
@TcPhilBushnell your trick works for me, but I also had to use 'stop.autoplay.owl' instead of 'stop.owl.autoplay'. |
The code will look for Generally it's ill advised to edit vendor code unless there's no way of fixing an issue with additional code. |
Looked for problem and found that |
Thanks @TcPhilBushnell! That fix was huge! Thanks again |
Looks like on the
For my purposes I just commented out the |
Holy crap @TcPhilBushnell, you just stopped me from throwing my entire desk out my window! Thank you so much for that fix! |
Thanks a lot! @TcPhilBushnell it's cool to be you) |
thanks @TcPhilBushnell . For start/play autoplay again after stop, I have changed this code 'play.owl.autoplay': $.proxy(function(e, t, s) { 'play.owl.autoplay': $.proxy(function(e, t, s) { this is working for me . hope this will help anyone need this play again funtionality |
This fix for autoplay problems. ` Autoplay.prototype.stop = function() {
|
Hello,
I've this 2 rows in my code:
owl.trigger('stop.owl.autoplay');
owl.trigger('to.owl.carousel',[index],[0]);
but the carousel doesn't stop. If I remove the first row the stop works.
Can you help me?
Best Regards
Stefano
The text was updated successfully, but these errors were encountered: