• Resolved pim87

    (@pim87)


    Is it possible to only auto slide on hover, so the exact opposite of Stop on hover? Pause when not hovered, play when hovered?

    Thanks.

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author simonpedge

    (@simonpedge)

    I would guess that is not outside the realm of possibility (but is certainly not a built-in feature).

    You would have to use sort of custom JavaScript coding to fire off the “play” & “stop” Autoplay events within Owl Carousel – see:
    https://owlcarousel2.github.io/OwlCarousel2/docs/api-events.html
    This probably wont be straight forward to figure out…

    Thread Starter pim87

    (@pim87)

    Thanks, solved it by using this JavaScript code:

    <script>
    	jQuery( document ).ready( function($) {	
    		var owl = $('.owl-carousel');
    		owl.trigger('stop.owl.autoplay');
    		$( '#slidename' ).hover(function() {
    		owl.trigger('play.owl.autoplay',[4000]);
    		}, function(){
    			owl.trigger('stop.owl.autoplay');
    		});
    	});
    </script>
    • This reply was modified 2 years, 9 months ago by pim87.
    Plugin Author simonpedge

    (@simonpedge)

    Ok, well done.

    And thanks for publishing your solution here – it may be useful for somebody else in the future ??

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Play on hover’ is closed to new replies.