开发者

jquery slide and timing

开发者 https://www.devze.com 2022-12-10 08:50 出处:网络
hey there, i have a div that expands when the pag开发者_运维知识库e is loaded, now i need it to collapse after 30 seconds, does anybody have an idea about how to do it in query?

hey there, i have a div that expands when the pag开发者_运维知识库e 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(); 
    });


$(function(){
    $("#banner").slideDown(function() {
        setTimeout(function() {
            $("#banner").slideUp();
        }, 30000);
    });
});


To do this you'll need to use setTimeout

$(function(){
        //something
        setTimeout("slidedown()",30000);
}

function slidedown(){
   $("#banner").slideDown()
}
0

精彩评论

暂无评论...
验证码 换一张
取 消