【发布时间】:2011-08-25 05:17:55
【问题描述】:
编辑:当高度分辨率低于整个页面(例如:1024x768)时,可以在此页面中看到发生了什么:http://www.depositosalto.com.br/pagamentos.php
我尝试使用 javascript 调整具有页面内容的 div 的大小,以使页面在较小时始终适合整个屏幕。
我正在使用以下 javascript,它适用于其他导航器(Firefox、Opera)。在 Chrome 中,它也会调整 div 的大小,但与其他的不同,它不会推送位于内容 div 下方的页脚 div。
chrome有什么办法解决吗?
function defineContentHeight(height){
var screenHeight = window.innerHeight;
if (screenHeight > (height + 220)){
height = screenHeight - 220;
document.getElementById("content").style.height = height + "px";
}
else{
document.getElementById("content").style.height = height + "px";
}
}
【问题讨论】:
标签: javascript css google-chrome resize height