首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 网站开发 > asp.net >

Filefox下,ASP.net怎么实现页面自动适应屏幕大小

2012-05-31 
Filefox下,ASP.net如何实现页面自动适应屏幕大小?在Filefox下,ASP.net如何实现页面自动适应屏幕大小?不论

Filefox下,ASP.net如何实现页面自动适应屏幕大小?
在Filefox下,ASP.net如何实现页面自动适应屏幕大小?
不论分辨率和屏幕大小

[解决办法]
<style>
html,body <!-主要是兼容firefox-->
{
hright:100%;
}
</style>
===========
试试?
[解决办法]

JScript code
//获取不同浏览器的宽度高度核心代码一 var getPageScroll = function() {    var xScroll, yScroll;    if (self.pageYOffset) {      yScroll = self.pageYOffset;      xScroll = self.pageXOffset;    } else if (document.documentElement && document.documentElement.scrollTop) {     // Explorer 6 Strict      yScroll = document.documentElement.scrollTop;      xScroll = document.documentElement.scrollLeft;    } else if (document.body) {// all other Explorers      yScroll = document.body.scrollTop;      xScroll = document.body.scrollLeft;        }    return new Array(xScroll,yScroll)   }  // adapter from getPageSize() by quirksmode.com   var getPageHeight = function() {    var windowHeight    if (self.innerHeight) {    // all except Explorer      windowHeight = self.innerHeight;    } else if (document.documentElement && document.documentElement.clientHeight) { // Explorer 6 Strict Mode      windowHeight = document.documentElement.clientHeight;    } else if (document.body) { // other Explorers      windowHeight = document.body.clientHeight;    }        return windowHeight  }//获取不同浏览器的宽度高度核心代码二var getPageScroll = function (){        var yScroll;        if (self.pageYOffset) {            yScroll = self.pageYOffset;        } else if (document.documentElement && document.documentElement.scrollTop){ // Explorer 6 Strict            yScroll = document.documentElement.scrollTop;        } else if (document.body) {// all other Explorers            yScroll = document.body.scrollTop;        }        arrayPageScroll = new Array('',yScroll)         return arrayPageScroll;    }    var getPageSize = function(){         var xScroll, yScroll;         if (window.innerHeight && window.scrollMaxY) {             xScroll = document.body.scrollWidth;            yScroll = window.innerHeight + window.scrollMaxY;        } else if (document.body.scrollHeight > document.body.offsetHeight){ // all but Explorer Mac            xScroll = document.body.scrollWidth;            yScroll = document.body.scrollHeight;        } else { // Explorer Mac...would also work in Explorer 6 Strict, Mozilla and Safari            xScroll = document.body.offsetWidth;            yScroll = document.body.offsetHeight;        }        var windowWidth, windowHeight;        if (self.innerHeight) { // all except Explorer            windowWidth = self.innerWidth;            windowHeight = self.innerHeight;        } else if (document.documentElement && document.documentElement.clientHeight) { // Explorer 6 Strict Mode            windowWidth = document.documentElement.clientWidth;            windowHeight = document.documentElement.clientHeight;        } else if (document.body) { // other Explorers            windowWidth = document.body.clientWidth;            windowHeight = document.body.clientHeight;        }         // for small pages with total height less then height of the viewport        if(yScroll < windowHeight){            pageHeight = windowHeight;        } else {             pageHeight = yScroll;        }        if(xScroll < windowWidth){             pageWidth = windowWidth;        } else {            pageWidth = xScroll;        }        arrayPageSize = new Array(pageWidth,pageHeight,windowWidth,windowHeight)         return arrayPageSize;    }
[解决办法]
<div id="fullDIV"></div>

<script type="text/javascript">

var divEl = document.getElementById('fullDIV');

window.onresize = window.onload = function() {


if(divEl) {
divEl.style.width = document.body.clientWidth + "px";
divEl.style.height = document.body.clientHeight + "px";
}
};



</script>

热点排行