//对象,宽,高
function ShowWindow(obj,obj1,obj2){
var panel=document.getElementById(obj);
var cwidth = document.documentElement.clientWidth;
var cheight = document.documentElement.clientHeight;
var pwidht=parseInt(panel.style.width);
var pheight=parseInt(panel.style.height);
var moveX = 0;
var moveY = 0;
var moveTop = 0;
var moveLeft = 0;
var moveable = false;
var docMouseMoveEvent = document.on
var docMouseUpEvent = document.on
var bgObj = document.createElement("div");
bgObj.id='back';
document.body.appendChild(bgObj);
var i=3;
bgObj.style.cssText = "position:absolute;left:0px;top:0px;width:"+cwidth+"px;height:"+cheight+"px;filter:Alpha(Opacity="+i*10+");opacity:"+i/10+";background-color:#000000;z-index:0;";
document.body.cssText=bgObj;
with(panel.style){
left=((cwidth-pwidht)/2)+"px";
top=((cheight-pheight)/2)+"px";
position='absolute';
filter='Alpha(Opacity=100)';
opacity='1';
}
panel.style.display='block';
panel.on
var evt = GetBrowseEvent();
moveable = true;
moveX = evt.clientX;
moveY = evt.clientY;
moveTop = parseInt(panel.style.top);
moveLeft = parseInt(panel.style.left);
document.on
if (moveable) {
var evt = GetBrowseEvent();
var x = moveLeft + evt.clientX - moveX;
var y = moveTop + evt.clientY - moveY;
if ( x > 0 &&( x + obj1 < cwidth) && y > 0 && (y + obj2 < cheight) ) {
with(panel.style){
left = x + "px";
top = y + "px";
filter='Alpha(Opacity=30)';
opacity='0.5';
}
}
}
};
document.on
if (moveable) {
document.on
document.on
moveable = false;
moveX = 0;
moveY = 0;
moveTop = 0;
moveLeft = 0;
with(panel.style){
filter='Alpha(Opacity=100)';
opacity='1';
}
}
};
}
}
function GetBackGroup(){
}
function GetBrowseEvent() {
return window.event || arguments.callee.caller.arguments[0];
}
var state;
function CloseWindow(obj){
document.getElementById(obj).style.display='none';
if(document.getElementById('back')!=null)
{
document.getElementById('back').parentNode.removeChild(document.getElementById('back'));
}
}
function CloseWindows(obj,end){
if (end>0){
with(document.getElementById(obj).style){
filter='Alpha(Opacity='+end+')';
opacity=''+end/10+'';
}
state= setTimeout(CloseWindows(obj,end-1),100);
}else{
end=0;
clearInterval(state);
}
}
评论