
放置两个easyui的dialog,如何让这两个都居中
1个回答
展开全部
function getPageWidth() {
if ($.browser.msie) {
return document.compatMode == 'CSS1Compat'
? document.documentElement.clientWidth
: document.body.clientWidth;
} else {
return self.innerWidth;
}
}
function getPageHeight() {
if ($.browser.msie) {
return document.compatMode == 'CSS1Compat'
? document.documentElement.clientHeight
: document.body.clientHeight;
} else {
return self.innerHeight;
}
}
$.extend($.fn.dialog.defaults,{
onMove : function(left,top){
var win = $(this).parent(), style = win.get(0).style, maxLeft = getPageWidth() - win.outerWidth(), maxTop = getPageHeight() - win.outerHeight();
if (left < 0) {
style.left = 0;
}
if (top < 0) {
style.top = 0;
}
if (left > maxLeft) {
style.left = maxLeft + 'px';
}
if (top > maxTop) {
style.top = maxTop + 'px';
}
}
});
求采纳
追问
追答
我一直是这样做的,不管多少个都可以,
还有一点你为什么要用dialog来做是否确定的事件,你不能用messager么?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询