div大小变化问题
<script type="text/javascript">var width=document.body.clientWidth;
var height=document.body.clientHeight;
//alert(width);
document.getElementById("data").style.width=width-260+"px";
document.getElementById("data").style.height=height-140+"px";
document.getElementById("content").style.width=width-260+"px";
var mydiv=document.getElementById("data");
var mydiv_resize=function(){
mydiv.style.width=document.body.clientWidth-260+"px";
mydiv.style.height=document.body.clientHeight-140+"px";
}
mydiv_resize();
window.onresize=mydiv_resize;
</script>可是窗口变化时div没有变化,请教