Easyui 让Window弹出居中
2014-02-23 13:30
274 查看
原文:Easyui 让Window弹出居中easyui1.3.2版本,window的弹出不会居中了。而dialog是会居中的,我们必须为为window的open事件做扩展
代码如下:只要加入以下代码即可.如果你是看了MVC项目系列的,把他放到jquery.easyui.plus.js里面就可以了
完美居中。
代码如下:只要加入以下代码即可.如果你是看了MVC项目系列的,把他放到jquery.easyui.plus.js里面就可以了
//让window居中 var easyuiPanelOnOpen = function (left, top) { var iframeWidth = $(this).parent().parent().width(); var iframeHeight = $(this).parent().parent().height(); var windowWidth = $(this).parent().width(); var windowHeight = $(this).parent().height(); var setWidth = (iframeWidth - windowWidth) / 2; var setHeight = (iframeHeight - windowHeight) / 2; $(this).parent().css({/* 修正面板位置 */ left: setWidth, top: setHeight }); if (iframeHeight < windowHeight) { $(this).parent().css({/* 修正面板位置 */ left: setWidth, top: 0 }); } $(".window-shadow").hide(); }; $.fn.window.defaults.onOpen = easyuiPanelOnOpen;
完美居中。
相关文章推荐
- Easyui 让Window弹出居中与最大化后居中
- Easyui 让Window弹出居中与最大化后居中
- Easyui 让Window弹出居中
- EasyUI刚加载时候Window窗体自动弹出的解决办法
- 【库房】easyui的messager.show弹出框页面居中显示
- easyui window自动居中(修复了iframe弹窗被遮盖问题)
- EasyUI的一点使用与研究(弹出框的居中与刷新)
- window.open弹出窗口居中
- EasyUI刚加载时候Window窗体自动弹出的解决办法
- 弹出窗口居中(window.open)
- 用window.open打开的新窗口如何居中弹出
- window.open()弹出居中的窗口
- JS中window.open弹出窗口居中
- window.open 弹出居中窗口
- window.open 弹出居中窗口
- open.window弹出窗口实现居中
- window.open()弹出居中的窗口
- EasyUI 1.3.3 火狐下弹出window框无法居中的解决办法
- JS中window.open弹出窗口居中
- JavaScript基础 window.open(url,name,options) 弹出一个 新窗口 屏幕居中显示 获取屏幕的有效宽度