easyui使用layou时自适应窗口
2016-04-06 16:04
501 查看
一、使用asp.net 自带的form;
二、用div代替asp.net 自带的form;
一、使用asp.net 自带的form;
由于aspx页面的特殊性,class='easyui-layout'如果直接放在body上,用div作region,会因为中间间隔著名的<form id="form1" runat="server" >服务器控件,而出现缺失节点的错误;
目前可行的方法是把class='easyui-layout'放到<form id="form1" runat="server" >服务器控件内,同时,让form自动适应body的高宽;
具体操作为,取window的高宽,设置给form;
其中,为了给body四周留出一定的margin,取出的window高宽各减去10,同时把body的margin:5px;
用div代替asp.net 自带的form:
//窗口自适应调整
$(function() {
windowResize(); //文档载入时加载
$(window).resize(function() {
windowResize(); //窗口改变大小时加载
});
});
function windowResize() {
var width = $(window).width()-10; //减去10与body中margin:5px共同作用:为body留的边距
var height = $(window).height()-10;
// $('form#form1').width(width);
// $('form#form1').height(height);
// $('form#form1').layout(); //相当于<form id='form1' class='easyui-layout' runat="server">
$('#autoFitWindow').width(width);
$('#autoFitWindow').height(height);
$('#autoFitWindow').layout(); //相当于<form id='form1' class='easyui-layout' runat="server">
}
二、用div代替asp.net 自带的form;
一、使用asp.net 自带的form;
由于aspx页面的特殊性,class='easyui-layout'如果直接放在body上,用div作region,会因为中间间隔著名的<form id="form1" runat="server" >服务器控件,而出现缺失节点的错误;
目前可行的方法是把class='easyui-layout'放到<form id="form1" runat="server" >服务器控件内,同时,让form自动适应body的高宽;
具体操作为,取window的高宽,设置给form;
其中,为了给body四周留出一定的margin,取出的window高宽各减去10,同时把body的margin:5px;
用div代替asp.net 自带的form:
//窗口自适应调整
$(function() {
windowResize(); //文档载入时加载
$(window).resize(function() {
windowResize(); //窗口改变大小时加载
});
});
function windowResize() {
var width = $(window).width()-10; //减去10与body中margin:5px共同作用:为body留的边距
var height = $(window).height()-10;
// $('form#form1').width(width);
// $('form#form1').height(height);
// $('form#form1').layout(); //相当于<form id='form1' class='easyui-layout' runat="server">
$('#autoFitWindow').width(width);
$('#autoFitWindow').height(height);
$('#autoFitWindow').layout(); //相当于<form id='form1' class='easyui-layout' runat="server">
}
相关文章推荐
- UISearchDisplayController索引栏背景透明
- UISearchDisplayController索引栏背景透明
- 基于Vue 和 webpack的项目实现
- marquee在IE8版本(兼容模式)不滚动
- [BTS] The value "" for the property InboundId is invalid
- iOS UICollectionViewCell 的拖动
- LEAPMOTION开发UI专题(1)
- EasyUI+bootsrtap混合前端框架
- iOS 8.1中UIImagePickerController的相机镜头旋转bug
- UITableViewCell 基础编
- java中的多线程包---CompletionService Executor + BlockingQueue
- UIScrollView的delaysContentTouches与canCencelContentTouches属性
- UIMotionEffect和Home页背景视差效果
- Ui学习笔记---EasyUI的使用方法,EasyLoader组件使用
- imbue(std::locale("chs"))
- iOS开发概述UIkit动力学
- INSTALL_FAILED_UID_CHANGED
- vue.js
- UIsearchBar怎么将canal改为取消,怎么点击取消按钮将键盘和searchbar复原
- easyui 动态修改窗口title