`
literary_fly
  • 浏览: 90525 次
  • 性别: Icon_minigender_1
  • 来自: 西安
社区版块
存档分类
最新评论

extjs 如何自动缩放

阅读更多
例如 可编辑的grid面板 
var grid_material = new Ext.grid.EditorGridPanel({ 
width:document.body.clientWidth, 
height:document.body.clientHeight, 
}] 


如果你的面板是包含在jsp页面里面的,上面的设置可以让你获取jsp页面的大小,拖动鼠标改变浏览器大小后,页面随着改变,这样设置自然就可以获得页面大小了,就能随着浏览器改变了  我就是这样做的,效果还不错。 

如果你只是靠jsp页面去引导,整个系统就是用ext去做,本身就是自适应的。 


一下是相关资料  可以从中找到适合你的 
out += "<br />网页可见区域宽:"+   document.body.clientWidth;   
out += "<br />网页可见区域高:"+   document.body.clientHeight;   
out += "<br />网页可见区域宽:"+   document.body.offsetWidth     +"   (包括边线和滚动条的宽)";   
out += "<br />网页可见区域高:"+   document.body.offsetHeight   +"   (包括边线的宽)";   
out += "<br />网页正文全文宽:"+   document.body.scrollWidth;   
out += "<br />网页正文全文高:"+   document.body.scrollHeight;   
out += "<br />网页被卷去的高:"+   document.body.scrollTop;   
out += "<br />网页被卷去的左:"+   document.body.scrollLeft;   
out += "<br />网页正文部分上:"+   window.screenTop;   
out += "<br />网页正文部分左:"+   window.screenLeft;   
out += "<br />屏幕分辨率的高:"+   window.screen.height;   
out += "<br />屏幕分辨率的宽:"+   window.screen.width;   
out += "<br />屏幕可用工作区高度:"+   window.screen.availHeight;   
out += "<br />屏幕可用工作区宽度:"+   window.screen.availWidth;   
out += "<br />你的屏幕设置是   "+   window.screen.colorDepth   +"   位彩色";   
out += "<br />你的屏幕设置   "+   window.screen.deviceXDPI   +"   像素/英寸"; 
// XHTML1.0规范 

var docHeight =document.documentElement.clientHeight;//网页可见区域宽 
var docHeightWithBorder=document.documentElement.offsetHeight //网页可见区域高(包括边线的宽) 
var bodyWidth =document.body.clientWidth; //网页可见区域宽 
var bodyHeight =document.body.clientHeight; //网页可见区域高 
var bodyWidthWithBorder =document.body.offsetWidth; //网页可见区域宽(包括边线的宽) 
var bodyHeightWithBorder=document.body.offsetHeight; //网页可见区域高(包括边线的宽) 
var bodyWidthWithScroll =document.body.scrollWidth; //网页正文全文宽 
var bodyHeightWithScroll=document.body.scrollHeight; //网页正文全文高 
var bodyTopHeight =document.body.scrollTop; //网页被卷去的上边距 
var bodyLeftWidth =document.body.scrollLeft; //网页被卷去的左边距 
var windowTopHeight =window.screenTop; //网页正文部分上边距 
var windowLeftWidth =window.screenLeft; //网页正文部分左边距 
var screenHeight =window.screen.height; //屏幕分辨率的高 
var screenWidth =window.screen.width; //屏幕分辨率的宽 
var screenAvailHeight =window.screen.availHeight; //屏幕可用工作区高度 
var screenAvailWidth =window.screen.availWidth; //屏幕可用工作区宽度 


分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics