Owlcarousel2: autoplayHoverPause not working properly

Created on 12 May 2016  路  7Comments  路  Source: OwlCarousel2/OwlCarousel2

Function works incorrectly in version 2.1.0
If to establish autoplayHoverPause:true
Version 2.0.0-beta.2.4
http://www.owlcarousel.owlgraphic.com/demos/autoplay.html - works correctly
Version 2.1.0
http://owlcarousel2.github.io/OwlCarousel2/demos/autoplay.html - Autoplay doesn't renew

Most helpful comment

Here is a temporary fix:

  $('.owl-carousel .owl-item').on('mouseenter',function(e){
    $(this).closest('.owl-carousel').trigger('stop.owl.autoplay');
  })
  $('.owl-carousel .owl-item').on('mouseleave',function(e){
    $(this).closest('.owl-carousel').trigger('play.owl.autoplay',[500]);
  })

All 7 comments

Same issue found and trying to resolve.

Here is a temporary fix:

  $('.owl-carousel .owl-item').on('mouseenter',function(e){
    $(this).closest('.owl-carousel').trigger('stop.owl.autoplay');
  })
  $('.owl-carousel .owl-item').on('mouseleave',function(e){
    $(this).closest('.owl-carousel').trigger('play.owl.autoplay',[500]);
  })

@despecial: Thank you. This work for me.

@despecial Hmm that didn't work for me.

Depends on your version of the script and code implementation.

See #1942


$(document).ready(function () {
    var owl = $('.owl-carousel');
    owl.on('mouseleave', function (e) {
        var data = $(e.currentTarget).data('owl.carousel');
        //console.log('autoplay:' + data.settings.autoplay + ' autoplayTimeout' + data.settings.autoplayTimeout);
        if (data.settings.autoplay) {
            $(e.currentTarget).trigger('stop.owl.autoplay');
            $(e.currentTarget).trigger('play.owl.autoplay', data.settings.autoplayTimeout);
            //console.log('It is working autoplay:' + data.settings.autoplay + ' autoplayTimeout' + data.settings.autoplayTimeout);
        }
    });
});

Was this page helpful?
0 / 5 - 0 ratings

Related issues

leighfarrell picture leighfarrell  路  3Comments

Uranbold picture Uranbold  路  3Comments

leecollings picture leecollings  路  3Comments

hemanthsp picture hemanthsp  路  3Comments

shofer4eto picture shofer4eto  路  4Comments