Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR HTML

alpine hide element after set time

<div x-data="{ show: true}"
     x-init="setTimeout(() => show = false, 4000)"
     x-show="show"
    class="fixed bottom-3 right-3 bg-blue-500 text-white py-2 px-4 rounded-xl text-xs">
    <p>I will disappear after 4 seconds</p>
</div>
Source by laracasts.com #
 
PREVIOUS NEXT
Tagged: #alpine #hide #element #set #time
ADD COMMENT
Topic
Name
6+3 =