I have the following element:
<div class="text hide">Hello SO</div>
I show it with jQuery like this:
$('.text').addClass('show').removeClass('hide');
So my <div> is show.
I want now it fade to hide again after 1 second.
Could you please help me ?
Thanks
You can use delay() and use show() to show the item and hide() to hide the item
$('.text').show(1).delay(1000).hide(1);
Note : You need to set duration for show() and hide() to work the deley()
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With