Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR HTML

carousel in tailwind css

<div id="intro" class="transition-all ease-in-out duration-1000 transform "></div>
<script>
    setInterval(() => {
        var random_im_id = Math.floor(Math.random() * (3) + 1)
        console.log(random_im_id)
        document.getElementById('intro').style.backgroundImage = 'url(./img/carousel-top/carousel-' + random_im_id + '.jpg)'
    }, 3000);
</script>
Source by flowbite.com #
 
PREVIOUS NEXT
Tagged: #carousel #tailwind #css
ADD COMMENT
Topic
Name
2+7 =