国产一级a片免费看高清,亚洲熟女中文字幕在线视频,黄三级高清在线播放,免费黄色视频在线看
打開APP
未登錄
開通VIP,暢享免費電子書等14項超值服
開通VIP
首頁
好書
留言交流
下載APP
聯(lián)系客服
js通過封裝div方式彈出div窗體
JT_man
>《頁面窗口》
2014.02.21
關(guān)注
<!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><title>js通過封裝div方式彈出div窗體</title><meta http-equiv="Content-Type" content="text/html;charset=gb2312" /> <style type="text/css"> .mask{position: absolute; top: 0px; left: 0px; filter: alpha(opacity=50); -moz-opacity:0.5; opacity:0.5; background-color: #ffffff; z-index: 2; display: none;} /* 彈出基本資料div */div.sample_popup {height:auto; border: 1px solid #327eca; width: 300px; } div.menu_form_header{ background: url('../images/baseInfo/titleBG.gif') repeat-x;} div.sample_popup div.menu_form_header { border-bottom: 0px; cursor: default; width:100%; height: 22px; line-height: 22px; vertical-align: middle; text-decoration: none; font-family: "Times New Roman", Serif; font-weight: 800; font-size: 13px; color: #206040; } div.menu_form_body { width:100%; height:150px; font-size:12px; background-color:#f1f8fe;} div.sample_popup input.menu_form_exit { float: right; margin: 4px 5px 0px 0px; cursor: pointer; } /*end: 彈出商品信息div */ </style><script type="text/javascript">/************************************************** * DivWindow.js **************************************************/var DivWindow= function(popup/*最外層div id*/,popup_drag/*拖動div id*/,popup_exit/*退出按鈕id*/ ,exitButton/*觸發(fā)服務(wù)器端退出按鈕id*/,varwidth,varheight,zindex){ this.popup =popup ; //窗口名稱 this.popup_drag=popup_drag; this.height =varheight ; //窗口高度,并沒用來設(shè)置窗口高度寬度,用來定位在屏幕的位置 this.width =varwidth ; //窗口寬度 this.popup_exit=popup_exit; this.exitButton=exitButton; this.zindex=zindex; this.init = function(){ //初始化窗口 this.popupShow(); this.startDrag(); //設(shè)置拖動 this.setCommond(); //設(shè)置關(guān)閉 DivWindow.ArrayW.push(document.getElementById(this.popup)); //存儲窗口到數(shù)組 };this.init();};//存儲窗口到數(shù)組DivWindow.ArrayW = new Array();//字符串連接類DivWindow.StringBuild = function(){ this.arr = new Array(); this.push = function(str){ this.arr.push(str); }; this.toString = function(){ return this.arr.join(""); };};//拖動類DivWindow.Drag = function(o ,oRoot){ var _self = this; //拖動對象 this.obj = (typeof oRoot != "undefined") ?oRoot : o; this.relLeft = 0; //記錄橫坐標(biāo) this.relTop = 0; //記錄縱坐標(biāo) o.onselectstart = function(){ return false; }; o.onmousedown = function(e){ //鼠標(biāo)按下 e = _self.fixE(e); _self.relLeft = e.clientX - _self.fixU(_self.obj.style.left); _self.relTop = e.clientY - _self.fixU(_self.obj.style.top); document.onmousemove = function(e){ _self.drag(e); //_self.obj.style.border = "1px dashed #000000"; //_self.obj.style.filter = "alpha(opacity=30)"; //_self.obj.style.opacity = "0.3"; }; document.onmouseup = function(){ _self.end(); //_self.obj.style.border = "1px solid #cccccc"; //_self.obj.style.borderBottom = "2px solid #E0E0E0"; //_self.obj.style.borderRight = "2px solid #E0E0E0"; //_self.obj.style.filter = "alpha(opacity=100)"; //_self.obj.style.opacity = "1"; }; }; this.drag = function(e){ //拖動 e = this.fixE(e); var l = e.clientX - this.relLeft; var t = e.clientY - this.relTop; if (t < 0) { t = 0; //防止頭部消失 } this.obj.style.left = l +"px"; this.obj.style.top = t +"px"; }; this.end = function(){ //結(jié)束拖動 document.onmousemove = null; document.onmouseup = null; }; this.fixE = function(e){ //修復(fù)事件 if (typeof e == "undefined") e = window.event; return e; }; this.fixU = function(u){ //處理px單位 return parseInt(u.split("p")[0]); };};//窗口拖動DivWindow.prototype.startDrag = function(){ var obj = document.getElementById(this.popup); var drag = document.getElementById(this.popup_drag); new DivWindow.Drag(drag,obj);};//設(shè)定窗口優(yōu)先級DivWindow.prototype.setTop = function(){ document.getElementById(this.popup).onclick = document.getElementById(this.popup).onmousedown = function(){ for(var i=0;i<DivWindow.ArrayW.length;i++) { DivWindow.ArrayW[i].style.zIndex = 1; } this.style.zIndex = 100; }; };//顯示DivWindow.prototype.popupShow=function() { document.getElementById('mask').style.display="block"; document.getElementById('mask').style.width=window.screen.width +20; document.getElementById('mask').style.height=window.screen.width +20; var element = document.getElementById(this.popup); element.style.position = "absolute"; element.style.visibility = "visible"; element.style.display = "block"; element.style.width=this.width; element.style.height='auto'; element.style.left = (window.screen.width - this.width)/2+"px"; //element.style.top =(window.screen.height-this.height-100)/2+"px"; element.style.top =20+"px"; element.style.zIndex=this.zindex;} //設(shè)置關(guān)閉DivWindow.prototype.setCommond = function(){ var _self = this; //根對象 var obj = document.getElementById(this.popup); var exit = document.getElementById(this.popup_exit); var triggServerEvent=document.getElementById(this.exitButton); //設(shè)置關(guān)閉 exit.onclick = function(){ obj.style.display = "none"; obj.style.visibility = 'hidden'; document.all.mask.style.display='none'//關(guān)閉遮罩層 triggServerEvent.click();//觸發(fā)服務(wù)器端退出事件 };};</script></head><body><div> <input type="button" id="show" onclick="javascript:new DivWindow('popup','popup_drag','popup_exit','exitButton','500','700',4);" value='點擊彈出窗口' /> <input type="button" id="exitButton" value="aaaa" /> </div> <!-- 遮罩層 --> <div id="mask" class="mask"> </div><!-- 彈出基本資料詳細(xì)DIV層 --><div class="sample_popup" id="popup" style="visibility: hidden; display: none;"> <div class="menu_form_header" id="popup_drag"> <input type="button" id="popup_exit" value="退出" /> 站長工具:<a >www.zzgjj.com.cn</a></div> <div class="menu_form_body" > <div id="popDetail"> 片區(qū)名稱:<input type="button" id="Button1" onclick="javascript:new DivWindow('Div1','Div2','exit2','exitButton','500','700',5);" value='再次點擊觸發(fā)' /> <br /> </div> </div></div><!-- 彈出基本資料詳細(xì)DIV層 --><div class="sample_popup" id="Div1" style="visibility: hidden; display: none;"> <div class="menu_form_header" id="Div2"> <input type="button" id="exit2" value="退出" /> </div> <div class="menu_form_body" > <div id="Div3"> C++學(xué)習(xí)網(wǎng):<a >站長工具</a><br/>溫馨提示,這個窗口可以拖動 </div> </div></div></body></html>
js通過封裝div方式彈出div窗體
本站僅提供存儲服務(wù),所有內(nèi)容均由用戶發(fā)布,如發(fā)現(xiàn)有害或侵權(quán)內(nèi)容,請
點擊舉報
。
打開APP,閱讀全文并永久保存
查看更多類似文章
猜你喜歡
類似文章
js制作一個簡單的div彈窗:
用彈出的DIV層代替彈出窗口,并使背景網(wǎng)頁變暗,并蓋住主頁面上的Flash_windows...
css 背景透明,文字不透明,alpha濾鏡,opacity,position:relat...
又到周末了,我們一起來研究【瀏覽器如何檢測是否安裝app】吧
DIV始終居中的半透明彈出層
CSS+JS折角廣告代碼
更多類似文章 >>
生活服務(wù)
首頁
萬象
文化
人生
生活
健康
教育
職場
理財
娛樂
藝術(shù)
上網(wǎng)
留言交流
回頂部
聯(lián)系我們
分享
收藏
點擊這里,查看已保存的文章
導(dǎo)長圖
關(guān)注
一鍵復(fù)制
下載文章
綁定賬號成功
后續(xù)可登錄賬號暢享VIP特權(quán)!
如果VIP功能使用有故障,
可點擊這里聯(lián)系客服!
聯(lián)系客服
微信登錄中...
請勿關(guān)閉此頁面
先別劃走!
送你5元優(yōu)惠券,購買VIP限時立減!
5
元
優(yōu)惠券
優(yōu)惠券還有
10:00
過期
馬上使用
×