Div default setting appears at the top, and slide show or hide

HTML
  div is hidden by default, if you want the default display, remove the inside style "display: none;" to

<div id="msg" style="display:none;z-index:99;width:100%;background:#d2d2d2;margin-left:0;margin-right:0;padding-right:15px;padding-left:15px;padding-top:15px;padding-bottom:15px;box-shadow:inset 0px -10px 16px rgba(22, 22, 23, 0.62);"></div>

js

// 延时0.2秒开始滑动显示(1000表示元素从隐藏到可见的速度,可为空)
setTimeout(function () {
    // slideDown() 方法通过使用滑动效果,显示隐藏的被选元素
    $('#msg').slideDown(1000);
    // slideUp() 方法通过使用滑动效果,隐藏显示的被选元素
    $("msg").slideUp();
}, 200);

Reference Address: the jQuery effect function

Guess you like

Origin blog.51cto.com/1197822/2456068