JS控制id 为”divv”的层在屏幕中间

function show(){

  var width=document.getElementById(“divv”).style.width;

  var height=document.getElementById(“divv”).style.height;

  with(document.getElementById(“divl”).style){  
          left = (window.screen.width-width)/2+document.documentElement.scrollLeft;
          top  = (window.screen.height-height)/2+document.documentElement.scrollTop;

          position=\’absolute\’
          zIndex = 1001
      }  

  document.getElementById(“divv”).style.display = “block”;

}

版权声明:本文为tqspring原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明。
本文链接:https://www.cnblogs.com/tqspring/archive/2010/01/19/1651499.html