弹出式DIV窗口效果,带拖动和阴影

demo

  • <script language=“javascript”>
  • var Obj=
  • document.onmouseup=MUp
  • document.onmousemove=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=;
  • }
  • }
  • script>
  • head><body>
  • <div id=“massage_box”><div class=“massage”>
  • <div class=“header” onmousedown=MDown(massage_box)><div style=“display:inline; width:150px; position:absolute”>本站提示信息div>
  • <span onClick=“massage_box.style.visibility=’hidden'; mask.style.visibility=’hidden'” style=“float:right; display:inline; cursor:hand”>×span>div>
  • 测试内容div>div>
  • <div id=“mask”>div>
  • <span onClick=“mask.style.visibility=’visible';massage_box.style.visibility=’visible'” style=“cursor:hand”><a href=“#”>显示提示信息a>span>
  • <br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br>bottom here
  • body>
  • html>
  • 演示代码

    Copyright © All Rights Reserved · Green Hope Theme by Sivan & schiy · Proudly powered by WordPress