标签:pre int asc null java load function ntop element
function fun(){
var wWidth = null,
wHeight = null; if(window.innerHeight && window.innerWidth){ wHeight = window.innerHeight;
wWidth = window.innerWidth; }else if((document.body) && (document.body.clientHeight) && (document.body.clientWidth)){
wWidth = window.clientWidth; wHeight = window.clientHeight; }
var boxWidth = document.getElementById("box").clientWidth; var boxHeight = document.getElementById("box").clientHeight;
box.style.marginLeft = (wWidth - boxWidth)/2 + "px"; box.style.marginTop = (wHeight - boxHeight)/2 + "px"; }
window.onload = window.onresize = function(){fun()}
标签:pre int asc null java load function ntop element
原文地址:http://www.cnblogs.com/laoniaofly/p/6031363.html