jQuery實(shí)現(xiàn)單擊按鈕遮罩彈出對話框效果(2)
本文實(shí)例為大家分享了jQuery實(shí)現(xiàn)彈出對話框的具體實(shí)現(xiàn)代碼,供大家參考,具體內(nèi)容如下
首先,這里的引用jquery-1.4.4.min.js和jquery.XYTipsWindow.min.2.8.js這兩個(gè)js,還有一個(gè)jquery.XYTipsWindow.2.8.css話不多說,這里直接上代碼,留著以后備用。
<html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>無標(biāo)題文檔</title> <!--使用對畫框需要的兩個(gè)js--> <script type="text/javascript" src="../js/jquery-1.4.4.min.js"></script> <script type="text/javascript" src="../js/jquery.XYTipsWindow.min.2.8.js"></script> <link href="../css/jquery.XYTipsWindow.2.8.css" rel="external nofollow" type="text/css" rel="stylesheet" /> <script type="text/javascript"> $(document).ready(function() { $("#change").click(function(){ $.XYTipsWindow({ ___title:"修改密碼", ___boxID:"change_pwd", ___content:"id:pwd", ___width:"200", ___height:"100", ___showbg:true, ___drag:"___boxTitle" }); }); $("#no").click(function(){ //alert("ss"); $.XYTipsWindow.removeBox(); }); $("#ok").click(function(){ //alert("ss"); $.XYTipsWindow.removeBox(); //獲取input的值 //$(".newpwd").val() }); }) </script> </head> <body style="text-align:center; padding-top:100px;"> <button id="change">修改密碼</button> <div id="pwd"><div class="input"><input class="newpwd" value="請輸入" stylr="color:gray;" onfocus="javascript:if(this.value == '請輸入') this.value='';this.style.color='#00CCCC';" onblur="javascript:if(this.value == '') this.value='請輸入';this.style.color='gray';"/></div> <div class="button"> <input id="ok" type="button" value="確定"/> <input id="no" type="button" value="取消"/> </div> </div> <style type="text/css"> #pwd{ display:none; } .button{ margin-bottom:10px; padding-top:10px; } .newpwd{ margin:10px; border:1px thin; } </style> </div> </body> </html>
效果圖:
以上就是本文的全部內(nèi)容,希望對大家的學(xué)習(xí)有所幫助,也希望大家多多支持腳本之家。
相關(guān)文章
JQuery Ajax執(zhí)行跨域請求數(shù)據(jù)的解決方案
今天小編就為大家分享一篇關(guān)于JQuery Ajax執(zhí)行跨域請求數(shù)據(jù)的解決方案,小編覺得內(nèi)容挺不錯(cuò)的,現(xiàn)在分享給大家,具有很好的參考價(jià)值,需要的朋友一起跟隨小編來看看吧2018-12-12基于jquery日歷價(jià)格、庫存等設(shè)置插件
這篇文章主要為大家詳細(xì)介紹了基于jquery日歷價(jià)格、庫存等設(shè)置插件,文中示例代碼介紹的非常詳細(xì),具有一定的參考價(jià)值,感興趣的小伙伴們可以參考一下2017-06-06jQuery實(shí)現(xiàn)select模糊查詢(反射機(jī)制)
這篇文章主要為大家詳細(xì)介紹了jQuery實(shí)現(xiàn)select帶模糊查詢的條件查詢,具有一定的參考價(jià)值,感興趣的小伙伴們可以參考一下2017-01-01jQuery拖動div、移動div、彈出層實(shí)現(xiàn)原理及示例
正如標(biāo)題所言的實(shí)現(xiàn)原理是使div的position為絕對定位absolute,然后控制其top與left值,需要的朋友可以參考下2014-04-04