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

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

Open
kuhashmi1974 opened this issue Apr 20, 2024 · 0 comments

Comments

@kuhashmi1974
Copy link

kuhashmi1974 commented Apr 20, 2024

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

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

1 participant