温馨提示:代码在线浏览功能只能做为源码浏览参考,如果想更进一步了解该代码请下载:漂亮实用的自定义对话框源码及Demo
当前文件:
DialogExample/Com.EEShou.Www.TreeControl/js/TreeControlsBackGround.js[4K,2009-6-12 11:38:49],打开代码结构图
DialogExample/Com.EEShou.Www.TreeControl/js/TreeControlsBackGround.js[4K,2009-6-12 11:38:49],打开代码结构图1///////////////////////////////////////////////////////////////////// 2
//// //// 3
//// BackGround //// 4
//// Namespace: TreeControls.js.BackGround.js //// 5
//// CreateName: Tree //// 6
//// Email: treeyh@126.com //// 7
//// Version: 1.0 bate4 //// 8
//// CreateDate: 2008-2-18 //// 9
//// //// 10
///////////////////////////////////////////////////////////////////// 11
12
13
14
///pageloadshowMsg 15
Tree.addEvent(window,'load',function () 16
{ 17
iTree_DialogBox_pageHeight=Tree.docHeight(); 18
19
if(Tree.$('TreeOverlayBackgroundDiv')['style']['display']=="block") 20
{ 21
var obackGround = Tree.$('TreeOverlayBackgroundDiv'); 22
obackGround.style.top="0px"; 23
TreeDialogBoxmiddle("TreeDialogBoxDiv"); 24
obackGround.style.height = iTree_DialogBox_pageHeight; 25
obackGround.style.width = Tree.docWidth(); 26
27
var oDialogBoxDiv = Tree.$("TreeDialogBoxDiv"); 28
if(oDialogBoxDiv) 29
{ 30
iTree_DialogBox_MoveMaxHeight = iTree_DialogBox_pageHeight - parseInt(oDialogBoxDiv.offsetHeight); 31
32
var sClientWidth = document.documentElement.clientWidth; 33
var sWidth = document.body.clientWidth; 34
35
if(sClientWidth < sWidth) 36
{ 37
iTree_DialogBox_scrollwidth = parseInt(document.documentElement.scrollWidth) - parseInt(document.body.clientWidth); 38
iTree_DialogBox_MoveMaxWidth = parseInt(sWidth) - iTree_DialogBox_scrollwidth - parseInt(oDialogBoxDiv.offsetWidth); 39
} 40
else if(sClientWidth == sWidth) 41
{ 42
iTree_DialogBox_MoveMaxWidth = parseInt(document.documentElement.offsetWidth) - iTree_DialogBox_scrollwidth - parseInt(oDialogBoxDiv.offsetWidth); 43
} 44
} 45
} 46
}); 47
48
/*windowSizeChange*/ 49
Tree.addEvent(window, 'resize' , function () 50
{ 51
if(Tree.$('TreeOverlayBackgroundDiv')['style']['display']=="block") 52
{ 53
Tree.$('TreeOverlayBackgroundDiv').style.height = parseInt(iTree_DialogBox_pageHeight) > parseInt(Tree.docWidth()) ? iTree_DialogBox_pageHeight : Tree.docWidth(); 54
55
var oTreeDialogBox = Tree.$("TreeDialogBoxDiv"); 56
if(oTreeDialogBox) 57
{ 58
59
iTree_DialogBox_MoveMaxHeight = iTree_DialogBox_pageHeight - parseInt(oTreeDialogBox.offsetHeight); 60
61
Tree.$('TreeOverlayBackgroundDiv').style.width = Tree.docWidth(); 62
iTree_DialogBox_MoveMaxWidth = Tree.docWidth() - parseInt(oTreeDialogBox.offsetWidth); 63
TreeDialogBoxmiddle('TreeDialogBoxDiv'); 64
} 65
} 66
}); 67
68
function TreeControls_ShowBackGround() 69
{ 70
var bgDivHeight = document.body.clientHeight; 71
bgDivHeight = document.documentElement.clientHeight>bgDivHeight?document.documentElement.clientHeight: bgDivHeight; 72
Tree.$('TreeOverlayBackgroundDiv').style.height = bgDivHeight; 73
74
var sClientWidth = document.documentElement.scrollWidth; 75
var sWidth = document.body.clientWidth; 76
if(sWidth < sClientWidth) 77
{ 78
Tree.$('TreeOverlayBackgroundDiv').style.width = sClientWidth; 79
iTree_DialogBox_MoveMaxWidth = sClientWidth - 398; 80
} 81
else if(sWidth == sClientWidth) 82
{ 83
Tree.$('TreeOverlayBackgroundDiv').style.width = sClientWidth; 84
iTree_DialogBox_scrollwidth = parseInt(document.documentElement.offsetWidth) - parseInt(document.body.clientWidth); 85
iTree_DialogBox_MoveMaxWidth = parseInt(document.documentElement.offsetWidth) - iTree_DialogBox_scrollwidth - 398; 86
} 87
else 88
{ 89
Tree.$('TreeOverlayBackgroundDiv').style.width = sWidth; 90
iTree_DialogBox_MoveMaxWidth = parseInt(sWidth)- 398; 91
} 92
}





iTree_DialogBox_pageHeight
}
}