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

📄 ycode_combo_box.js

📁 电子商务网站使用MVC模式B/S结构功能不是很全适合初学者看
💻 JS
字号:
var x956203888448 = new Array(); 
function x956203888449(x956203888450, x956203888451) {
	this.x956203888452 = document.all[x956203888450];
	this.x956203888452.selectedIndex = -1; 
	this.x956203888453 = x956203888453; 
	this.x956203888454 = x956203888454; 
	this.x956203888455 = x956203888455;
	this.x956203888456 = x956203888456; 
	this.x956203888457 = x956203888457; 
	this.x956203888458 = x956203888458; 
	this.x956203888459 = x956203888459; 
	this.x956203888460 = x956203888460; 
	this.x956203888461 = x956203888461; 
	this.x956203888462 = x956203888462; 
	this.x956203888463 = x956203888463; 
	this.x956203888464 = x956203888464; 
	this.focus = focus; 
	this.x956203888465 = x956203888465; 
	this.x956203888466 = x956203888466;
	this.x956203888467 = x956203888467;
	this.x956203888468 = false; 
	this.x956203888469 = false;
	this.x956203888470 = false;
	this.x956203888471 = false; 
	this.x956203888472 = "";
	var x956203888473 = x956203888450 + "_text"; 
	if (document.all[x956203888473] != null) { 
		alert("The following id: '" + x956203888473 +"' is used internally by the Combo Box!\r\n"+ "Use of this id in your page may cause malfunction. Please use another id for your controls.");
	}
	var x956203888474 = "<INPUT type='text' id=" + x956203888473 + " name=" + x956203888473 + " onblur='" + x956203888451 + ".x956203888456()' " + " onkeyup='" + x956203888451 + ".x956203888462()' " + " style='display: none; position: absolute' value='' >";
	this.x956203888452.insertAdjacentHTML("afterEnd", x956203888474); this.x956203888475 = document.all[x956203888473]; var x956203888476 = x956203888450 + "_value"; 
	if (document.all[x956203888476] != null) { 
		alert("The following id: '" + x956203888476 + "' is used internally by the Combo Box!\r\n"+ "Use of this id in your page may cause malfunction. Please use another id for your controls."); 
	}
    var x956203888477 = "<INPUT type='hidden' "+ " id=" + x956203888476 + " name=" + x956203888476 + " >";
    this.x956203888452.insertAdjacentHTML("afterEnd", x956203888477); 
	this.x956203888478 = document.all[x956203888476]; 
	this.x956203888479 = false; 
	this.x956203888454(); 
	x956203888448[x956203888448.length] = this;
}
function x956203888457(x956203888480) { 
	this.x956203888468 = x956203888480;
} 
function x956203888463(x956203888481) { 
	this.x956203888470 = x956203888481;
}
function x956203888464(x956203888482) {
	this.x956203888471 = x956203888482; }
function x956203888461(x956203888483, x956203888484) { 
	this.x956203888469 = x956203888483;
	var x956203888485;
	if (x956203888483) { 
		if (x956203888461.arguments.length == 1) {
			x956203888484 = false;
		}
		var x956203888486 = this.x956203888452.options.length; 
		var x956203888487;
		var x956203888488; 
		var x956203888489;
		var x956203888490; 
		var x956203888491;
		for (x956203888485=0; x956203888485<x956203888486; x956203888485++) {
			x956203888487 = x956203888485; 
			x956203888488 = this.x956203888452.options(x956203888485).text; 
			if (x956203888484) {
				x956203888488 = parseFloat(x956203888488);
			} 
			for (x956203888491=x956203888485+1; x956203888491<x956203888486; x956203888491++) { 
				x956203888490 = this.x956203888452.options(x956203888491).text; 
				if (x956203888484) {
					x956203888490 = parseFloat(x956203888490); 
				} if (x956203888488 > x956203888490) { 
					x956203888487 = x956203888491; x956203888488 = this.x956203888452.options(x956203888491).text;
				}
			}
			if (x956203888485 != x956203888487) {
				x956203888489 = document.createElement("OPTION"); x956203888489.text = x956203888488;
				x956203888489.value = this.x956203888452.options(x956203888487).value;
				var x956203888492 = this.x956203888452.selectedIndex; 
				this.x956203888452.options.remove(x956203888487);
				this.x956203888452.add(x956203888489, x956203888485);
				if (x956203888492 == x956203888487) {
					this.x956203888452.selectedIndex = x956203888485;
				}
				else if ( (x956203888492 < x956203888487) && (x956203888492 >= x956203888485) ) {
					this.x956203888452.selectedIndex = x956203888492 + 1; 
				} 
			}
		}
	}
} 
function x956203888456() { 
	var x956203888493 = this.x956203888452; 
	var x956203888494 = this.x956203888475;
	var x956203888495 = this.x956203888478; 
	var x956203888485; x956203888495.value = x956203888494.value;
  	x956203888493.selectedIndex = -1; 
  	if (x956203888494.value == "") {
   		return; 
   	}
    var x956203888486 = x956203888493.options.length; 
	for (x956203888485=0; x956203888485<x956203888486; x956203888485++) { 
		var x956203888496 = x956203888493.options(x956203888485).text; 
		var x956203888497 = x956203888494.value;
		if (this.x956203888471) {
			x956203888496 = x956203888496.toUpperCase();
	  		x956203888497 = x956203888497.toUpperCase();
	    }
	    if (x956203888496 == x956203888497) { 
	   		x956203888493.selectedIndex = x956203888485; 
	   		x956203888495.value = x956203888493.options(x956203888485).value; 
	   		return;
	    } 
	}
	if (this.x956203888468) {
		x956203888493.focus();
		alert("'" + x956203888494.value + "' is not allowed");
		this.x956203888452.selectedIndex = -1; 
		this.x956203888475.select();
		return; 
	}
}
function x956203888465( x956203888498 ) { 
	if ((x956203888498 == null) || (x956203888498 == "") ) {
		x956203888498 = this.x956203888475.value; 
	} 
	var x956203888486 = this.x956203888452.options.length;
	var x956203888485; 
	this.x956203888475.value = x956203888498; 
	this.x956203888475.select();
	this.x956203888475.focus();
	for (x956203888485=0; x956203888485<x956203888486; x956203888485++) {
		if (this.x956203888452.options(x956203888485).text == x956203888498) {
			this.x956203888452.selectedIndex = x956203888485; return;
		}
	}
	var x956203888489 = document.createElement("OPTION"); 
	x956203888489.text = x956203888498; x956203888489.value = x956203888498;
	this.x956203888452.add(x956203888489); 
	this.x956203888452.selectedIndex = x956203888486;
	if (this.x956203888469) { 
		this.x956203888461(true); 
	}
	window.resizeBy(0, -1);
	this.x956203888454();
	window.resizeBy(0, 1);
}

function x956203888466( x956203888498 ) { 
	if ((x956203888498 == null) || (x956203888498 == "") ) { 
		x956203888498 = this.x956203888475.value;
	} 
	var x956203888486 = this.x956203888452.options.length; var x956203888485; 
	var x956203888499 = -1; 
	for (x956203888485=0; x956203888485<x956203888486; x956203888485++) {
		if (this.x956203888452.options(x956203888485).text == x956203888498) {
		x956203888499 = x956203888485; break; 
		} 
	} 
	if (x956203888499 == -1) { 
		return; 
	} 
	this.x956203888452.remove(x956203888499); 
	this.x956203888452.selectedIndex = -1; 
	this.x956203888475.value = ""; 
	this.x956203888454();
}
function x956203888454() { 
	if (!this.x956203888479) { 
		this.x956203888479 = true; 
		this.x956203888475.style.display="none"; 
		this.x956203888452.style.position="static";
		this.x956203888475.style.posLeft = x956203888511(this.x956203888452);
		this.x956203888475.style.posTop = x956203888514(this.x956203888452) + 1; 
		this.x956203888475.style.posWidth = this.x956203888452.offsetWidth - 16; 
		this.x956203888475.style.posHeight = this.x956203888452.offsetHeight;
		this.x956203888452.style.position ="absolute";
		this.x956203888452.style.posLeft = this.x956203888475.style.posLeft; 
		this.x956203888452.style.posTop = this.x956203888475.style.posTop;
		this.x956203888500 = this.x956203888452.offsetWidth; 
		var x956203888501 = "rect(0 " + (this.x956203888452.offsetWidth) + " " + this.x956203888452.offsetHeight + " " + (this.x956203888475.style.posWidth - 2 ) + ")"; this.x956203888452.style.clip = x956203888501; 
		this.x956203888475.style.display=""; 
		this.x956203888479 = false;
	} 
}
function x956203888455() {
	var x956203888502 = this.x956203888452.selectedIndex; var x956203888503 = this.x956203888452.options[x956203888502]; 
	this.x956203888475.value = x956203888503.text;
	this.x956203888475.focus();
	this.x956203888475.select();
	this.x956203888452.selectedIndex=-1;
}
function x956203888453() {
	return this.x956203888475.value; 
}
function x956203888467() {
	return this.x956203888478.value;
}
function x956203888459(x956203888504) { 
	var x956203888486 = this.x956203888452.options.length;
	var x956203888485; 
	for (x956203888485=0; x956203888485<x956203888486; x956203888485++) { 
		if (this.x956203888452.options(x956203888485).text == x956203888504) { 
			this.x956203888452.selectedIndex = x956203888485;
			this.x956203888475.value = this.x956203888452.options(x956203888485).text;
			this.x956203888478.value = this.x956203888452.options(x956203888485).value; 
			return;
		} 
	} 
	this.x956203888452.selectedIndex = -1; this.x956203888475.value = "";
} 
function x956203888458(x956203888498) {
	var x956203888486 = this.x956203888452.options.length; 
	var x956203888485; 
	for (x956203888485=0; x956203888485<x956203888486; x956203888485++) {
		if (this.x956203888452.options(x956203888485).value == x956203888498) {
			this.x956203888452.selectedIndex = x956203888485;
			this.x956203888475.value = this.x956203888452.options(x956203888485).text;
			this.x956203888478.value = this.x956203888452.options(x956203888485).value;
			return;
		}
	} 
	this.x956203888452.selectedIndex = -1; this.x956203888475.value = ""; 
}
function x956203888460(x956203888485) {
	var x956203888486 = this.x956203888452.options.length; 
	if ((x956203888485 >=0) && (x956203888485 < x956203888486)) { 
		this.x956203888452.selectedIndex = x956203888485; 
		this.x956203888475.value = this.x956203888452.options(x956203888485).text;
		this.x956203888478.value = this.x956203888452.options(x956203888485).value; return;
	} 
	this.x956203888475.value = "";
}
function x956203888462() { 
	if (this.x956203888470) { 
		if (event.keyCode < 32) { 
			return;
		}
		var x956203888505 = this.x956203888475.value;
		var x956203888506 = this.x956203888472;
		var x956203888485; 
		if ((x956203888505 == "") || (x956203888505 == x956203888506) ) {
			this.x956203888472 = x956203888505; return;
		} 
		var x956203888486 = this.x956203888452.options.length;
		var x956203888507;
		for (x956203888485=0; x956203888485<x956203888486; x956203888485++) {
			x956203888507 = this.x956203888452.options(x956203888485).text; 
			if (this.x956203888471) {
				x956203888507 = x956203888507.toUpperCase(); 
				x956203888505 = x956203888505.toUpperCase(); 
			} 
			if (x956203888507.indexOf(x956203888505) == 0) {
				var x956203888508 = this.x956203888452.options(x956203888485).text; 
				this.x956203888475.value = this.x956203888475.value + x956203888508.substr(x956203888505.length);
				this.x956203888452.selectedIndex = x956203888485; 
				this.x956203888472 = this.x956203888475.value;
				var x956203888509 = this.x956203888475.createTextRange(); 
				x956203888509.moveStart("character", x956203888505.length);
				x956203888509.select(); 
				return;
			} 
		}
	}
} 
function focus() { 
	this.x956203888475.focus();
}
function x956203888510() {
	var x956203888485;
	for (x956203888485=0; x956203888485 < x956203888448.length; x956203888485++) {
		x956203888448[x956203888485].x956203888454(); 
	} 
} 

⌨️ 快捷键说明

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