Show div after 10 secs and hide after 10 secs

后端 未结 6 1420
[愿得一人]
[愿得一人] 2021-01-17 07:04

I need to show a div (e.g. #mybox) in 10secs after page load, keep it visible for another 10 secs and then hide with a nice sliding in/out effects.

Thanks a lot for

6条回答
  •  迷失自我
    2021-01-17 07:16

    Perhaps you can try something like this.

    setTimeout(show_div, 10000);
    setTimeout(hide_div, 20000);
    
    funciton show_div(){
        $('#mybox').show();
    }
    
    funciton hide_div(){
        $('#mybox').hide();
    }
    

提交回复
热议问题