87,996
社区成员




<html>
<head>
<title>onresize.html</title>
<style type="text/css">
*{
font-size:12px;
font-family:宋体, Arial;
font-weight:normal;
color:#333;
}
#greenDiv{
width:240px;
height:16px;
border:2px solid #00DD00;
background-color:#BBF0BB;
}
</style>
<script type="text/javascript">
function refresh_div(){
var div_width = 240, div_height = 160;
document.getElementById("div").style.position = "absolute";
$("div").style.left = (document.body.offsetWidth - div_width)/2;
$("div").style.top = (document.body.offsetHeight - div_height)/2;
}
function $(str){
return document.getElementById(str);
}
window.onload = window.onresize = refresh_div();
</script>
</head>
<body>
<div id="div" name="div"></div>
</body>
</html>
<html>
<head>
<title>onresize.html</title>
<style type="text/css">
*{
font-size:12px;
font-family:宋体, Arial;
font-weight:normal;
color:#333;
}
#greenDiv{
width:240px;
height:160px;
border:2px solid #00DD00;
background-color:#BBF0BB;
}
</style>
<script type="text/javascript">
function refresh_div(){
var div_width = 240, div_height = 160;
document.getElementById("greenDiv").style.position = "absolute";
$("greenDiv").style.left = (document.body.clientWidth - div_width)/2;
$("greenDiv").style.top = (document.body.clientHeight - div_height)/2;
}
function $(str){
return document.getElementById(str);
}
window.onload = window.onresize = refresh_div;
</script>
</head>
<body>
<div id="greenDiv"></div>
</body>
</html>
window.onload = window.onresize = refresh_div()
window.onload = window.onresize = refresh_div