jquery實(shí)現(xiàn)彈窗(系統(tǒng)提示框)效果
本文實(shí)例為大家分享了jquery實(shí)現(xiàn)系統(tǒng)提示框的具體代碼,供大家參考,具體內(nèi)容如下
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <script src="js/jquery-1.11.1.js"></script> <title>彈窗效果</title> <style> *{ margin: 0;padding: 0;list-style: none} .mask{background-color:rgba(0,0,0,0.2); width:100%; height:100%;position:fixed;top:0;left:0;} .prompt_box{width:400px;height:200px;background:#ffffff;border-radius:6px; position:fixed;top:25%; left:50%; margin-left:-200px;overflow: hidden;} .prompt_box .prompt_title{height:40px;line-height:40px;padding-left:20px;border-bottom:2px solid #1a9ebf;background:#e6e6e6;position: relative;} .prompt_box .prompt_title h3{font-size:16px;color: #333333; margin-top:0;} .prompt_box .prompt_cancel{width:24px;height:24px;background: url("img/cancel.png") no-repeat;position: absolute;right:0;top:0;} .prompt_box .prompt_cont{position: relative;height:158px;} .prompt_box .prompt_cont .prompt_text{line-height:140px;padding-left:100px;} .prompt_box .prompt_cont .prompt_sure{position: absolute;right:20px;bottom:34px; width:50px;height: 26px;background:#1a9ebf;border-radius:5px;color:#ffffff; font-size: 14px;line-height:26px;text-align: center;} .hide{display:none;} .show{display:block;} </style> </head> <body> <input type="button" value="按鈕" id="btn"> <div class="mask hide"> <div class="prompt_box"> <div class="prompt_title"> <h3>系統(tǒng)提示</h3> <span class="prompt_cancel"></span> </div> <div class="prompt_cont"> <p class="prompt_text">輸入有誤,請(qǐng)重新輸入!</p> <span class="prompt_sure">確定</span> </div> </div> </div> <script> $(function () { (function () { //////////////////////////彈窗效果//////////////////////////////// $('#btn').click(function () { $('.prompt_text').text('輸入有誤,請(qǐng)重新輸入!'); $('.mask').removeClass('hide'); }) $('.prompt_sure,.prompt_cancel').click(function () { $('.mask').addClass('hide'); }) })(); }); </script> </body> </html>
效果圖顯示:
以上就是本文的全部?jī)?nèi)容,希望對(duì)大家的學(xué)習(xí)有所幫助,也希望大家多多支持腳本之家。
- 基于jQuery的投票系統(tǒng)顯示結(jié)果插件
- jQuery動(dòng)態(tài)地獲取系統(tǒng)時(shí)間實(shí)現(xiàn)代碼
- jQuery 1.9.1源碼分析系列(十)事件系統(tǒng)之主動(dòng)觸發(fā)事件和模擬冒泡處理
- jQuery實(shí)現(xiàn)B2B網(wǎng)站后臺(tái)管理系統(tǒng)側(cè)導(dǎo)航
- jQuery利用DOM遍歷實(shí)現(xiàn)商城結(jié)算系統(tǒng)實(shí)戰(zhàn)
- jQuery實(shí)現(xiàn)簡(jiǎn)易商城系統(tǒng)項(xiàng)目實(shí)操
相關(guān)文章
jquery實(shí)現(xiàn)表單驗(yàn)證簡(jiǎn)單實(shí)例演示
這篇文章向大家推薦了一個(gè)jquery實(shí)現(xiàn)表單驗(yàn)證簡(jiǎn)單實(shí)例演示,需要的朋友可以參考下2015-11-11jQuery插件jRumble實(shí)現(xiàn)網(wǎng)頁(yè)元素抖動(dòng)
jRumble是jquery的插件,可以讓你選擇的元素抖動(dòng)。 調(diào)用時(shí)只需一句代碼即可,有些抖動(dòng)效果還挺可愛(ài),可自定義的抖動(dòng)效果,十分的炫酷,有需要的小伙伴可以參考下。2015-06-06jquery使用正則表達(dá)式驗(yàn)證email地址的方法
這篇文章主要介紹了jquery使用正則表達(dá)式驗(yàn)證email地址的方法,以實(shí)例形式分析了正則表達(dá)式的使用技巧,需要的朋友可以參考下2015-01-01jquery實(shí)現(xiàn)滑動(dòng)圖片自己測(cè)試的例子
最近使用jquery寫(xiě)了一個(gè)圖片滑動(dòng)的插件,雖然還是有些問(wèn)題存在,用法很簡(jiǎn)單,希望對(duì)大家有所幫助2013-11-11jQuery實(shí)現(xiàn)網(wǎng)頁(yè)抖動(dòng)的菜單抖動(dòng)效果
這篇文章主要介紹了jQuery實(shí)現(xiàn)網(wǎng)頁(yè)抖動(dòng)的菜單抖動(dòng)效果,鼠標(biāo)滑過(guò)菜單項(xiàng)可見(jiàn)到菜單項(xiàng)的抖動(dòng)效果,涉及jquery鼠標(biāo)事件及頁(yè)面元素樣式動(dòng)態(tài)操作的技巧,需要的朋友可以參考下2015-08-08Jquery on方法綁定事件后執(zhí)行多次的解決方法
下面小編就為大家?guī)?lái)一篇Jquery on方法綁定事件后執(zhí)行多次的解決方法。小編覺(jué)得挺不錯(cuò)的,現(xiàn)在就分享給大家,也給大家做個(gè)參考。一起跟隨小編過(guò)來(lái)看看吧2016-06-06jQuery設(shè)置div一直在頁(yè)面頂部顯示的方法
如何讓div一直在頁(yè)面頂部,這種類似的效果大家都有見(jiàn)過(guò)的,實(shí)現(xiàn)的方法也有很多,在本文為大家詳細(xì)介紹下使用jquery是如何實(shí)現(xiàn)的,感興趣的朋友不要錯(cuò)過(guò)2013-10-10