html实现层的显示与隐藏,JS与CSS结合实现DIV显示/隐藏透明层 |
您所在的位置:网站首页 › 十二生肖吉祥动物有哪些 › html实现层的显示与隐藏,JS与CSS结合实现DIV显示/隐藏透明层 |
JS与CSS结合实现DIV显示/隐藏透明层 #massage_box{ position:absolute; left:expression((body.clientWidth-massage_box.offsetWidth)/2); top:expression((body.clientHeight-300)/2); width:620px; height:400px;z-index:2; visibility:hidden} #mask{ position:absolute; top:0; left:0; width:expression(body.scrollWidth); height:expression(body.scrollHeight); background:#000000; filter:ALPHA(opacity=65); z-index:1; visibility:hidden; margin:auto} .massage{width:100%; height:100%; color:#036; font-size:12px; line-height:150%} var Obj='' document.οnmοuseup=MUp document.οnmοusemοve=MMove function MDown(Object){ Obj=Object.id document.all(Obj).setCapture() pX=event.x-document.all(Obj).style.pixelLeft; pY=event.y-document.all(Obj).style.pixelTop; } function MMove(){ if(Obj!=''){ document.all(Obj).style.left=event.x-pX; document.all(Obj).style.top=event.y-pY; } } function MUp(){ if(Obj!=''){ document.all(Obj).releaseCapture(); Obj=''; } } function sc1(){ document.getElementById("massage_box").style.top=document.body.scrollTop+(document.body.clientHeight-document.getElementById("massage_box").offsetHeight)/2 document.getElementById("massage_box").style.left=document.body.scrollLeft+(document.body.clientWidth-document.getElementById("massage_box").offsetWidth)/2; } function scall(){ sc1(); } window.οnscrοll=scall; window.οnresize=scall; window.οnlοad=scall; ![]() response.Write("") next %> 更多相关文章请关注PHP中文网(www.gxlcms.com)! 本条技术文章来源于互联网,如果无意侵犯您的权益请点击此处反馈版权投诉 本文系统来源:php中文网 |
今日新闻 |
点击排行 |
|
推荐新闻 |
图片新闻 |
|
专题文章 |
CopyRight 2018-2019 实验室设备网 版权所有 win10的实时保护怎么永久关闭 |