Reputation: 10218
I have a div which will display after some time .i.e on page load it will be invisible and after some duration it will be visible.
I tried this, but its not working for me.
setTimeout($(".startab").show(),4000);
$(".startab").delay(4000).show();
Upvotes: 1
Views: 10769
Reputation: 6025
Need to use a closure
setTimeout(function () {
$(".startab").show()
}, 4000);
setTimeout takes a function as the first parameter and you were passing it an object
Upvotes: 4
Reputation: 13079
setTimeout()
accepts a callback and a duration and should be called like this:
setTimeout(function() {$(".startab").show()},4000);
Upvotes: 1