Skip to content
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

using autoplay in the initial options forces the carousel to play when scrolling slides, even if carousel is stopped. #2223

Open
marklegault opened this issue Feb 16, 2018 · 4 comments

Comments

@marklegault
Copy link

Took me a while to narrow it down to this, but if you use Autoplay in the initial options and try to stop the carousel, if you manually change the slide it will automatically start again. This cannot be stopped even by using click, drag, or dragged events. I feel like it should keep the status when changing slides manually.

@pascalporedda
Copy link
Collaborator

Hey @marklegault

Please add a link to a page where I can verify this error. You can use a service like jsfiddle, plnkr, jsbin or codepen.

@marklegault
Copy link
Author

https://jsfiddle.net/knave79/9rtr14ek/25/

Click on the carousel to pause it, then drag the carousel. Will begin autoplaying once it's done dragging

@pascalporedda
Copy link
Collaborator

Ahh I see. I dunno if that would be the wanted behaviour. If the carousel is stopped and continued manually, why wouldn't want it to autoplay again? Like you just wanted to look at one specific slide.

Not sure about this one yet, but I will have some thoughts on that.

@tsai-jimmy
Copy link

tsai-jimmy commented Apr 3, 2018

hey @marklegault

I have same problem as you
We manually change the slide(ex: click $('.owl-nav) ) and it will automatically start again.
This can't stop forever even by using click btn which trigger the function
$('.owl-nav).trigger('stop.owl.autoplay');

But now I have resolved by following this:

// select the nav
$('.owl-nav > div').on('click', function () {
    // We used the owl-carousel Event API to stop autoplay
    $('.owl-carousel').trigger('stop.owl.autoplay');

    var carousel = $('.owl-carousel').data('owl.carousel');// <--you can console this,let you setting
    carousel.settings.autoplay = false;
    carousel.options.autoplay = false;
    $('.owl-carousel').trigger('refresh.owl.carousel');
});

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants