国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 網站 > WEB開發 > 正文

DIV彈出層 可移動 可關閉,demo直接使用

2024-04-27 15:13:02
字體:
來源:轉載
供稿:網友
<!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=utf-8" /><title>DOM_text01</title><style type="text/CSS">body,span,div,td{font-size:12px;line-height:1.5em;color:#849BCA;}#bodyL{float:left;width:384px;margin-right:2px;}#fd{position: absolute;top: 25%;left: 25%;border: 8px solid #A1D7FF;background-color: white;width:610px;height:500px;overflow:hidden;cursor:move;}.content{background:url(gg.gif) no-repeat; width:610px; height:32px;}</style></head><body><div id="bodyL"><a href="#" onclick = "show('fd');return false;">[打開層]</a><a href="#" onclick = "closeed('fd');return false;">[關閉層]</a></div> <div id="fd" style="display:none;filter:alpha(opacity=100);opacity:1;"><div class="content"><a href="#" style="float:right; width:50x; padding-top:5px; padding-right:5px;" onclick = "closeed('fd');return false;">   </a></div> <div style="padding:15px; font-size:14px; color:#000000">內容區內容區內容區內容區內容區內容區內容區內容區內容區內容區內容區內容區內容區內容區內容區內容區內容區內容區內容區內容區內容區內容區內容區內容區內容區內容區內容區內容區內容區內容區內容區內容區內容區內容區內容區內容區內容區內容區內容區內容區內容區內容區內容區內容區內容區內容區內容區內容區內容區內容區內容區內容區內容區內容區內容區 </div></div><script type="text/javascript">var PRox;var proy;var proxc;var proyc;function show(id){/*--打開--*/clearInterval(prox);clearInterval(proy);clearInterval(proxc);clearInterval(proyc);var o = document.getElementById(id);o.style.display = "block";o.style.width = "1px";o.style.height = "1px"; prox = setInterval(function(){openx(o,610)},10);} function openx(o,x){/*--打開x--*/var cx = parseInt(o.style.width);if(cx < x){   o.style.width = (cx + Math.ceil((x-cx)/5)) +"px";}else{   clearInterval(prox);   proy = setInterval(function(){openy(o,300)},10);}} function openy(o,y){/*--打開y--*/ var cy = parseInt(o.style.height);if(cy < y){   o.style.height = (cy + Math.ceil((y-cy)/5)) +"px";}else{   clearInterval(proy);   }} function closeed(id){/*--關閉--*/clearInterval(prox);clearInterval(proy);clearInterval(proxc);clearInterval(proyc); var o = document.getElementById(id);if(o.style.display == "block"){   proyc = setInterval(function(){closey(o)},10);   } } function closey(o){/*--打開y--*/ var cy = parseInt(o.style.height);if(cy > 0){   o.style.height = (cy - Math.ceil(cy/5)) +"px";}else{   clearInterval(proyc);       proxc = setInterval(function(){closex(o)},10);}} function closex(o){/*--打開x--*/var cx = parseInt(o.style.width);if(cx > 0){   o.style.width = (cx - Math.ceil(cx/5)) +"px";}else{   clearInterval(proxc);   o.style.display = "none";}}/*-------------------------鼠標拖動---------------------*/ var od = document.getElementById("fd"); var dx,dy,mx,my,mouseD;var odrag;var isIE = document.all ? true : false;document.onmousedown = function(e){var e = e ? e : event;if(e.button == (document.all ? 1 : 0)){   mouseD = true;   }}document.onmouseup = function(){mouseD = false;odrag = "";if(isIE){   od.releaseCapture();   od.filters.alpha.opacity = 100;}else{   window.releaseEvents(od.MOUSEMOVE);   od.style.opacity = 1;} }od.onmousedown = function(e){odrag = this;var e = e ? e : event;if(e.button == (document.all ? 1 : 0)){   mx = e.clientX;   my = e.clientY;   od.style.left = od.offsetLeft + "px";   od.style.top = od.offsetTop + "px";   if(isIE)   {    od.setCapture();        od.filters.alpha.opacity = 50;   }   else   {    window.captureEvents(Event.MOUSEMOVE);    od.style.opacity = 0.5;   }   } }document.onmousemove = function(e){var e = e ? e : event;if(mouseD==true && odrag){    var mrx = e.clientX - mx;   var mry = e.clientY - my;    od.style.left = parseInt(od.style.left) +mrx + "px";   od.style.top = parseInt(od.style.top) + mry + "px";      mx = e.clientX;   my = e.clientY;   }}</script></body></html>
發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
主站蜘蛛池模板: 兰溪市| 石景山区| 定陶县| 盐亭县| 绿春县| 射洪县| 合水县| 姜堰市| 隆昌县| 海门市| 江城| 丁青县| 龙岩市| 金昌市| 田阳县| 辽宁省| 同江市| 杨浦区| 隆子县| 新津县| 马山县| 信宜市| 奉新县| 广宁县| 唐山市| 泗洪县| 涞水县| 防城港市| 广德县| 丹凤县| 同心县| 谷城县| 普陀区| 故城县| 宁晋县| 崇左市| 民勤县| 桃江县| 平度市| 长沙市| 巴马|