琐定窗口

function $getById(id) {
return document.getElementById(id);
}
function lockWindow(myWindow) {
// 锁定页面之前,设置select菜单不可用
var sels = document.getElementsByTagName('select');
if (sels.length == 0) {
var contentFrame = window.frames['contentFrame'];
if (contentFrame != null && contentFrame != undefined
&& contentFrame.type != '') {
sels = contentFrame.document.getElementsByTagName('select');
}
}
//锁定窗口
setLockSize(myWindow);

var lockSelect = $getById("lockSelect");
var lockDiv = $getById("lockWindow");
var msgWin = $getById(myWindow);


lockDiv.style.display = "block";
lockSelect.style.display = "block";
msgWin.style.display = "block";

//设置锁定层随窗口大小改变的事件。
window.onresize = function(){setLockSize(myWindow)};
// 隐藏PDF窗口的iFrame
if (window.hideContentFrame) {
hideContentFrame();
}
}
function setLockSize(myWindow)
{
var lockiframe = $getById("lockiframe");
var lockSelect = $getById("lockSelect");
var lockDiv = $getById("lockWindow");
var msgWin = $getById(myWindow);

var w_body = document.body.scrollWidth;
var h_body = document.body.scrollHeight;
var w_win,h_win;
if (window.navigator.userAgent.indexOf("MSIE") >= 1) {
w_win = window.screen.availWidth-21;
h_win = window.screen.availHeight-window.screenTop-27;
}else{
w_win = window.innerWidth;
h_win = window.innerHeight;
if(h_win > jQuery(window).height())
{
w_win = window.screen.availWidth;
h_win = window.screen.availHeight;
}
}
if(w_body < w_win){w_body = w_win;}
if(h_body < h_win){h_body = h_win;}
lockDiv.style.display = "block";
lockDiv.style.width = w_body+"px";
lockDiv.style.height = h_body+"px";

lockSelect.style.display = "block";
lockSelect.style.width = w_body+"px";
lockSelect.style.height = h_body+"px";
lockiframe.style.width = w_body+"px";
lockiframe.style.height = h_body+"px";

msgWin.style.top = parseInt(h_body / 4)+"px";
msgWin.style.left = parseInt(w_body / 3.5)+"px";
}

/**
* 解锁窗口。
*
* @param myWindow
* 消息窗口ID。
*/
function unlockWindow(myWindow) {
var lockiframe = $getById("lockiframe");
var lockSelect = $getById("lockSelect");
var lockDiv = $getById("lockWindow");
var MsgWindow = $getById(myWindow);

// document.title="窗口已解除锁定";
lockDiv.style.width = 0;
lockDiv.style.height = 0;
lockDiv.style.display = "none";
MsgWindow.style.display = "none";
lockiframe.style.width = 0;
lockiframe.style.height = 0;
lockiframe.style.display = "none";
lockSelect.style.display = "none";
// 解除select菜单的锁定
var sels = document.getElementsByTagName('select');
if (sels != null) {
if (sels.length == 0) {
var contentFrame = window.frames['contentFrame'];
if (contentFrame != null && contentFrame != undefined
&& contentFrame.type != '') {
sels = contentFrame.document.getElementsByTagName('select');
}
}
for ( var i = 0; i < sels.length; i++) {
sels[i].disabled = false;
}
}
// 解除锁定层大小的改变事件
window.onresize = null;

// 解除隐藏PDF窗口的iFrame
if (window.showContentFrame) {
showContentFrame();
}

}
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值