Reputation: 24059
I'm hacking up a fix for jQuery slide down which jumps.
So far I have:
$div.hide().css({ height : 0 });
$div.show().animate({ height : height }, { duration: 1000 });
But I want to delay the showing of the div by 1 second. I've tried .delay(1000) but it doesn't work.
Upvotes: 0
Views: 27
Reputation: 23652
Fairly simple to execute.
$div.hide().css({ height : 0 });
setTimeout(function() {
$div.show().animate({ height : height }, { duration: 1000 }), 1000)
};
Upvotes: 1
Reputation: 44740
You can use setTimeout
setTimeout(function(){
$div.show().animate({ height : height }, { duration: 1000 });
},1000); // 1 second delay
Upvotes: 1