

|  | 
} 
/*初始化结束*/ 
////////对象事件定义///////  combox.prototype.change=function(){     
combox.prototype.find=function(){ 
/*当搜索到输入框的值时,下拉框自动定位*/ 
var inputbox=document.getElementsByName("combox_"+this.name)[0] 
with(this.select){ 
for(i=0;i
selectedIndex=i 
this.change(); 
break; 
} 
} 
} 
/*定义下拉框的onchange事件*/ 
var inputbox=document.getElementsByName("combox_"+this.name)[0] 
inputbox.value=this.select.options[this.select.selectedIndex].text; 
with(inputbox){select();focus()}; 
} 
////////对象事件结束/////// 
/*公用定位函数(获取控件绝对坐标)*/ 
function getL(e){ 
var l=e.offsetLeft; 
while(e=e.offsetParent)l+=e.offsetLeft; 
return l 
} 
function getT(e){ 
var t=e.offsetTop; 
while(e=e.offsetParent)t+=e.offsetTop; 
return t 
} 
/*结束*/ 
 script> 
 
var a=new combox("a","fason") 
a.init() 
 script> 
 
