Reputation: 1
I've been looking about how to fade a div after a set of time with jQuery.
I tried
$(test).fadeIn("slow").delay(2000)
But I think I am missing something on the code?
Upvotes: 0
Views: 233
Reputation: 1849
setTimeout(myFunc, 2000);
function myFunc(){
$(test).fadeIn('slow');
}
Upvotes: 0
Reputation: 5084
turn it around:
<div id="test" style="display:none">Hello!</div>
<script type="text/javascript">
$(function(){
$("#test").delay(2000).fadeIn("slow")
});
</script>
Upvotes: 0
Reputation: 21023
you need to delay first, and then attemot the fade in
$(test).delay(2000).fadeIn("slow");
Upvotes: 0