jQuery 中msgTips 頂部彈窗效果實現(xiàn)代碼
更新時間:2017年08月14日 11:01:59 作者:今晚再打老虎
最近發(fā)現(xiàn)好多網(wǎng)站都采用頂部彈窗,并且不用用戶手動去點擊確定。感覺這樣很方便用戶,下面小編把實現(xiàn)代碼分享給大家,感興趣的的朋友一起看看吧
最近發(fā)現(xiàn)好多網(wǎng)站都采用頂部彈窗,并且不用用戶手動去點擊確定。感覺這樣很方便用戶,所以也找了好多大神的代碼,整理一下方便以后查找
前端:
@{
Layout = null;
}
<!DOCTYPE HTML PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>jQuery網(wǎng)頁頂部顯示操作提示插件 - 聚合分享 - www.juheweb.com</title>
<link href="~/top/css/css.css" rel="external nofollow" rel="stylesheet" />
<script src="~/top/js/jquery-1.8.3.min.js"></script>
<script src="~/top/js/msgTips.js"></script>
<script type="text/javascript">
$(function () {
$("#ie").manhua_msgTips({
Event: "click", //響應(yīng)的事件
timeOut: 4000, //提示層顯示的時間
msg: "為了保證更好的網(wǎng)站體驗,請升級IE版本到8.0或以上!", //顯示的消息
speed: 0, //滑動速度
type: "warning" //提示類型(1、success 2、error 3、warning)
});
$("#no").manhua_msgTips({
Event: "click", //響應(yīng)的事件
timeOut: 3000, //提示層顯示的時間
msg: "很抱歉!您好操作此插件錯誤,請重新操作!", //顯示的消息
speed: 0, //滑動速度
type: "error" //提示類型(1、success 2、error 3、warning)
});
$("#yes").manhua_msgTips({
Event: "click", //響應(yīng)的事件
timeOut: 2000, //提示層顯示的時間
msg: "恭喜你!操作成功,歡迎訪問聚合分享網(wǎng)站", //顯示的消息
speed: 300, //滑動速度
type: "success" //提示類型(1、success 2、error 3、warning)
});
});
</script>
<style>
input {
padding: 10px 20px;
}
</style>
</head>
<body>
<div style="margin:300px auto; width:350px;">
<input type="button" id="ie" value="警告提示" />
<input type="button" id="no" value="錯誤提示" />
<input type="button" id="yes" value="成功提示" />
</div>
</body>
</html>
個人感覺還是很好用的,這個是從某位大神那里引用來的,如果有冒犯,麻煩告訴我,我會刪除的
總結(jié)
以上所述是小編給大家介紹的jQuery 中msgTips 頂部彈窗效果實現(xiàn)代碼,希望對大家有所幫助,如果大家有任何疑問請給我留言,小編會及時回復(fù)大家的。在此也非常感謝大家對腳本之家網(wǎng)站的支持!
相關(guān)文章
jquery validate 實現(xiàn)動態(tài)增加/刪除驗證規(guī)則操作示例
這篇文章主要介紹了jquery validate 實現(xiàn)動態(tài)增加/刪除驗證規(guī)則操作,結(jié)合實例形式分析了jQuery validate表單驗證相關(guān)操作技巧,需要的朋友可以參考下2019-10-10
jQuery的選擇器中的通配符[id^=''code'']或[name^=''code'']及jquery選擇器總結(jié)
這篇文章主要介紹了jQuery的選擇器中的通配符[id^='code']或[name^='code']及jquery選擇器總結(jié)的相關(guān)資料,需要的朋友可以參考下2015-12-12

