jQuery弹出div层过2秒自动消失
下面给大家分享一段代码关于jquery弹出div层并自动消失的实现代码,废话不多说了,具体代码如下所示:
var HuiFang={
m_tishi :null,//全局变量 判断是否存在div,
//提示div 等待2秒自动关闭
Funtishi: function (content, url) {
if (HuiFang.m_tishi == null) {
HuiFang.m_tishi = '<div class="xiaoxikuang none" id="app_tishi" style="z-index:9999;left: 15%;width:70%;position: fixed;background:none;bottom:10%;"> <p class="app_tishi" style="background: none repeat scroll 0 0 #000; border-radius: 30px;color: #fff; margin: 0 auto;padding: 1.5em;text-align: center;width: 70%;opacity: 0.8; font-family:Microsoft YaHei;letter-spacing: 1px;font-size: 1.5em;"></p></div>';
$(document.body).append(HuiFang.m_tishi);
}
$("#app_tishi").show();
$(".app_tishi").html(content);
if (url) {
window.setTimeout("location.href='" + url + "'", 1500);
} else {
setTimeout('$("#app_tishi").fadeOut()', 1500);
}
},
}使用:
HuiFang.Funtishi("请输入名字。"); 相关推荐
  86417413    2020-11-25  
   83206733    2020-11-19  
   86276537    2020-11-19  
   83266337    2020-11-19  
   86256434    2020-11-17  
   zhouboxiao    2020-11-16  
   rise    2020-11-22  
   sssdssxss    2020-11-20  
   windle    2020-11-10  
   孙雪峰    2020-10-30  
   xfcyhades    2020-11-20  
   liuxudong00    2020-11-19  
   cheidou    2020-11-19  
   gunhunti    2020-09-25  
   csdnYF    2020-11-15  
   达观数据    2020-11-11  
   playlinuxxx    2020-11-11  
 