1.css代码:
html,body{height:100%;} //考虑到内容很少时,body无法布满整个网页
#vip_div
{
position:absolute;
top:0;
left:0;
100%;
display:none;
z-index:20;
background-color: #C0C0C0;
opacity:0.6;
filter:alpha(opacity=60);
}
2.js代码:
function change()
{
document.getElementById("vip_div").style.height = document.documentElement.scrollHeight+"px";
//不加px,在火狐和谷歌上不能显示;document.documentElement.scrollHeight为document.body.scrollHeight时,谷歌、火狐不能全屏显示
document.getElementById("vip_div").style.display = "block";
}
3.html:
<div id=”vip_div”></div>
<input type=”button” onclick=”change();” />