Search code examples
javascriptwordpressowl-carousel

Wordpress theme implementation of owl carousel not stopping on hover


So I have an owl carousel slider, provided by the theme I'm using, but its not stopping autoplay on hover.

I have tried adding animation-play-state:paused to the :hover of the respective elements, but that didn't work. I'm not much of a Javascript guy, so I don't really know how to proceed.

This is the carousel html:

<div class="owl-carousel owl-loaded owl-drag" data-dots="false" data-nav="true" data-items="3" data-items-laptop="2" data-items-tab="1" data-items-mobile="1" data-items-mobile-sm="1" data-autoplay="true" data-loop="true" data-margin="30">

The slider is otherwise working perfectly.


Solution

  • Try to add:

    data-autoplay-hover-pause="true"
    

    So you will get:

    <div class="owl-carousel owl-loaded owl-drag" data-dots="false" data-nav="true" data-items="3" data-items-laptop="2" data-items-tab="1" data-items-mobile="1" data-items-mobile-sm="1" data-autoplay="true" data-loop="true" data-margin="30" data-autoplay-hover-pause="true">