jquery slide and timing
Question
hey there, i have a div that expands when the page is loaded, now i need it to collapse after 30 seconds, does anybody have an idea about how to do it in query?
$(function(){
$("#banner").slideDown();
});
Solution
$(function(){
$("#banner").slideDown(function() {
setTimeout(function() {
$("#banner").slideUp();
}, 30000);
});
});
OTHER TIPS
To do this you'll need to use setTimeout
$(function(){
//something
setTimeout("slidedown()",30000);
}
function slidedown(){
$("#banner").slideDown()
}
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow