Show div after 10 secs and hide after 10 secs

后端 未结 6 1419
[愿得一人]
[愿得一人] 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:28

    Ok in the future it's best to show us what you have tried so we can all help to improve your code.

    With out knowing what your dealing with I'll give you one of many way's to do it.

    Using jQuery

    setTimeout(function() {
      $('#div1').slideIn();
      setTimeout(function() {
         $('#div1').slideOut();    
      }, 10000);
    }, 10000);
    

提交回复
热议问题