flowbite icon indicating copy to clipboard operation
flowbite copied to clipboard

How to use Pause() method to stop slider on Hover in Tailwind CSS Carousel - Flowbite

Open kuhashmi1974 opened this issue 1 year ago • 0 comments

Hi, I am using Flowbite Default Carosul (Auto Play) . Know i want to pause the slider on hover. Contacted the support and due to lack to knowledge of Javascript I am not able to execute the pause() method. I their reply They gave me this information

You can use the instance manager to get the Carousel instance: https://flowbite.com/docs/getting-started/javascript/#instance-manager Something like: const carousel = FlowbiteInstances.getInstance('Carousel', 'your-carousel-id'); And then do something like: In JavaScript if the mouse is over the element, then call carousel.pause();

Know I use The script

<script type="application/javascript">               
            const carousel = FlowbiteInstances.getInstance('Carousel', 'default-carousel');       
        </script>

Then call the carousel.pause(); like that <div id="default-carousel" class="relative w-full" data-carousel="slide" onmouseover="carousel.pause();"> But it didn't work.

Can any one help me plz..

Regards, Kaleem

kuhashmi1974 avatar Apr 20 '24 13:04 kuhashmi1974