⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 eworld_ui_collapsablepanel.js

📁 j2ee源码
💻 JS
📖 第 1 页 / 共 2 页
字号:

function CollapsablePanel_IE_FindAttributeIndex(element, attName) {
	var attIndex = -1;
	if(element != null) {
		for(var i=0; i<element.attributes.length; i++) {
			if(element.attributes[i].name.toLowerCase() == attName) {
				attIndex = i;
				i = element.attributes.length;
			}
		}
	}
	return attIndex;
}

function CollapsablePanel_IE_SetStyle(element, attNumber, style) {
	if(element != null) {
		if(attNumber >= 0 && element.attributes[attNumber].value != 'null') {
			element.attributes[attNumber].value = style;
		}
	}
}

/*************************************************************************
* Upper Browser Javascript (NS 6+)
*************************************************************************/
function CollapsablePanel_NS_ExpandCollapse(hideThis, changeThis, setThis, exText, colText, slide, height, speed, lines, styleID, isCollapseClass, isExpandClass, collapsedStyle, expandedStyle, clientID, customFunc) {
	var elStyleLeft = null;
	var elStyleRight = null;
	var elStyleLink = null;
	var isCollapsing = false;
	
	if(styleID.indexOf(';') > 0) {
		elStyleLeft = document.getElementById(styleID.split(';')[0]);
		elStyleRight = document.getElementById(styleID.split(';')[1]);
		if(styleID.split(';').length == 3)
			elStyleLink = document.getElementById(styleID.split(';')[2]);
	} else {
		elStyleLeft = document.getElementById(styleID);
	}
	
	if(document.getElementById(hideThis).style.display == '') {
		isCollapsing = true;
		document.getElementById(hideThis).style.display = 'none';
		if(document.getElementById(changeThis) != null)
			document.getElementById(changeThis).innerHTML = exText;
		if(isCollapseClass) {
			if(elStyleLeft != null) {
				if(elStyleLeft.attributes['class'].value != null) {
					elStyleLeft.attributes['class'].value = collapsedStyle;
				}
			}
			if(elStyleRight != null) {
				if(elStyleRight.attributes['class'].value != null) {
					elStyleRight.attributes['class'].value = collapsedStyle;
				}
			}
			if(elStyleLink != null) {
				if(elStyleLink.attributes['class'].value != null) {
					elStyleLink.attributes['class'].value = collapsedStyle;
				}
			}
		} else {
			if(elStyleLeft != null) {
				if(elStyleLeft.attributes['style'] != null) {
					elStyleLeft.attributes['style'].value = collapsedStyle;
				}
			}
			if(elStyleRight != null) {
				if(elStyleRight.attributes['style'].value != null) {
					elStyleRight.attributes['style'].value = collapsedStyle;
				}
			}
			if(elStyleLink != null) {
				if(elStyleLink.attributes['style'].value != null) {
					elStyleLink.attributes['style'].value = collapsedStyle;
				}
			}
		}
		document.getElementById(setThis).value = 'true';
	} else {
		isCollapsing = false;
		document.getElementById(hideThis).style.display = '';
		if(document.getElementById(changeThis) != null)
			document.getElementById(changeThis).innerHTML = colText;
		if(isExpandClass) {
			if(elStyleLeft != null) {
				if(elStyleLeft.attributes['class'].value != null) {
					elStyleLeft.attributes['class'].value = expandedStyle;
				}
			}
			if(elStyleRight != null) {
				if(elStyleRight.attributes['class'].value != null) {
					elStyleRight.attributes['class'].value = expandedStyle;
				}
			}
			if(elStyleLink != null) {
				if(elStyleLink.attributes['class'].value != null) {
					elStyleLink.attributes['class'].value = expandedStyle;
				}
			}
		} else {
			if(elStyleLeft != null) {
				if(elStyleLeft.attributes['style'].value != null) {
					elStyleLeft.attributes['style'].value = expandedStyle;
				}
			}
			if(elStyleRight != null) {
				if(elStyleRight.attributes['style'].value != null) {
					elStyleRight.attributes['style'].value = expandedStyle;
				}
			}
			if(elStyleLink != null) {
				if(elStyleLink.attributes['style'].value != null) {
					elStyleLink.attributes['style'].value = expandedStyle;
				}
			}
		}
		document.getElementById(setThis).value = 'false';
	}
	
	if(customFunc != "")
		eval(customFunc + "('" + clientID + "', " + isCollapsing + ");");
}

function CollapsablePanel_NS_ExpandCollapseImage(hideThis, changeThis, setThis, expandUrl, collapseUrl, exText, colText, slide, height, speed, lines, styleID, isCollapseClass, isExpandClass, collapsedStyle, expandedStyle, clientID, customFunc) {
	var elStyleLeft = null;
	var elStyleRight = null;
	var elStyleLink = null;
	var isCollapsing = false;
	
	if(styleID.indexOf(';') > 0) {
		elStyleLeft = document.getElementById(styleID.split(';')[0]);
		elStyleRight = document.getElementById(styleID.split(';')[1]);
		if(styleID.split(';').length == 3)
			elStyleLink = document.getElementById(styleID.split(';')[2]);
	} else {
		elStyleLeft = document.getElementById(styleID);
	}
	
	if(document.getElementById(hideThis).style.display == '') {
		isCollapsing = true;
		document.getElementById(hideThis).style.display = 'none';
		if(document.getElementById(changeThis) != null) {
			document.getElementById(changeThis).src = expandUrl;
			document.getElementById(changeThis).alt = exText;
		}
		if(isCollapseClass) {
			if(elStyleLeft != null) {
				if(elStyleLeft.attributes['class'].value != 'null') {
					elStyleLeft.attributes['class'].value = collapsedStyle;
				}
			}
			if(elStyleRight != null) {
				if(elStyleRight.attributes['class'].value != 'null') {
					elStyleRight.attributes['class'].value = collapsedStyle;
				}
			}
			if(elStyleLink != null) {
				if(elStyleLink.attributes['class'].value != 'null') {
					elStyleLink.attributes['class'].value = collapsedStyle;
				}
			}
		} else {
			if(elStyleLeft != null) {
				if(elStyleLeft.attributes['style'].value != 'null') {
					elStyleLeft.attributes['style'].value = collapsedStyle;
				}
			}
			if(elStyleRight != null) {
				if(elStyleRight.attributes['style'].value != 'null') {
					elStyleRight.attributes['style'].value = collapsedStyle;
				}
			}
			if(elStyleLink != null) {
				if(elStyleLink.attributes['style'].value != 'null') {
					elStyleLink.attributes['style'].value = collapsedStyle;
				}
			}
		}
		document.getElementById(setThis).value = 'true';
	} else {
		isCollapsing = false;
		document.getElementById(hideThis).style.display = '';
		if(document.getElementById(changeThis) != null) {
			document.getElementById(changeThis).src = collapseUrl;
			document.getElementById(changeThis).alt = colText;
		}
		if(isExpandClass) {
			if(elStyleLeft != null) {
				if(elStyleLeft.attributes['class'].value != 'null') {
					elStyleLeft.attributes['class'].value = expandedStyle;
				}
			}
			if(elStyleRight != null) {
				if(elStyleRight.attributes['class'].value != 'null') {
					elStyleRight.attributes['class'].value = expandedStyle;
				}
			}
			if(elStyleLink != null) {
				if(elStyleLink.attributes['class'].value != 'null') {
					elStyleLink.attributes['class'].value = expandedStyle;
				}
			}
		} else {
			if(elStyleLeft != null) {
				if(elStyleLeft.attributes['style'].value != 'null') {
					elStyleLeft.attributes['style'].value = expandedStyle;
				}
			}
			if(elStyleRight != null) {
				if(elStyleRight.attributes['style'].value != 'null') {
					elStyleRight.attributes['style'].value = expandedStyle;
				}
			}
			if(elStyleLink != null) {
				if(elStyleLink.attributes['style'].value != 'null') {
					elStyleLink.attributes['style'].value = expandedStyle;
				}
			}
		}
		document.getElementById(setThis).value = 'false';
	}
	
	if(customFunc != "")
		eval(customFunc + "('" + clientID + "', " + isCollapsing + ");");
}

function CollapsablePanel_NS_DoNothing() {}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -