您好,欢迎访问一九零五行业门户网

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("请输入名字。");
以上所述是小编给大家介绍的jquery弹出div层过2秒自动消失
其它类似信息

推荐信息