var scrollWidth = document.documentElement.clientWidth; var scrollHeight = document.documentElement.clientHeight; var divWidth = $(".info").width(); var divHeight = $(".info").height(); var divLeft = scrollWidth/2-divWidth/2; var divTop = scrollHeight/2-divHeight/2; $(".info").css({"position":"absolute","top":divTop,"left":divLeft}).fadeIn('normal'); station=true; }else{ alert("状态错误!") }
});
$("#close").click(function(){ if(station==true){ $(".info").fadeOut('normal'); $(".backgroundDiv").fadeOut('normal'); station =false; } });