I have a div like this
<div id="sale">
........
</div>
and I tried to use both
$('#sale').delay(3000).slideDown(500);
and
setTimeout(sale(), 3000);
function sale() {
$('#sale').slideDown(500);
}
but neither of them are working. The jQuery delay says $('#sale').delay() is not a function while the setTimeout way says useless setTimeout call (missing quotes). If I add double quotes around the sale() call, it just says “Sale is not defined”.
Why won’t either of these work?
All I’m trying to do is make a div appear 3 seconds after the page is loaded.
In case of
setTimeoutyou’re simply doing it wrong.You need to pass in a function:
Other possibility:
And last but not least: