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

📄 xselect.js

📁 管理登录system 管理员:admin 密码:admin888 数据库链接文件: conn.asp 内容数据库前台链接文件 systemconn.asp 内容数据库后台链接文件 sy
💻 JS
字号:

function Dsy()
{
	this.Items = {};
}
Dsy.prototype.add = function(id,iArray)
{
	this.Items[id] = iArray;
}
Dsy.prototype.Exists = function(id)
{
	if(typeof(this.Items[id]) == "undefined") return false;
	return true;
}

function change(c,v){
	var str="0";
	var dsy = window.select[c].dsy;
	var s = window.select[c].Sel;
	for(i=0;i<v;i++){ str+=("_"+document.getElementById(s[i]).selectedIndex);};
	var ss=document.getElementById(s[v]);
	with(ss){
		length = 0;
		if(dsy.Exists(str)){
			var ar = dsy.Items[str];
			for(i=0;i<ar.length;i++) {
				var ot = ar[i][0];var ov = ar[i][1] ? ar[i][1] : ot;
				options[length]=new Option(ot,ov);
			}
		}
		else { options[0]=new Option("请选择","请选择");}
		if(++v<s.length){change(c,v);}
	}
}

function setup(iDsy,iS)
{
	if(!window.select)
	{ window.select = new Array();};
	var counter = window.select.length;
	window.select[counter] = { dsy: iDsy, Sel: iS };
	for(i=0;i<iS.length-1;i++)
		document.getElementById(iS[i]).onchange=new Function("change("+counter+","+(i+1)+")");
	change(counter,0);
}

⌨️ 快捷键说明

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