tqspring

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";

}

分类:

技术点:

相关文章: