/*表单*/ function diy_select(){this.init.apply(this,arguments)}; diy_select.prototype={ init:function(opt) { this.setopts(opt); this.o=this.getbyclass(this.opt.ttcontainer,document,'div');//容器 this.b=this.getbyclass(this.opt.ttdiy_select_btn);//按钮 this.t=this.getbyclass(this.opt.ttdiy_select_txt);//显示 this.l=this.getbyclass(this.opt.ttdiv_select_list);//列表容器 this.ipt=this.getbyclass(this.opt.ttdiy_select_input);//列表容器 this.lengths=this.o.length; this.showselect(); }, addclass:function(o,s)//添加class { o.classname = o.classname ? o.classname+' '+s:s; }, removeclass:function(o,st)//删除class { var reg=new regexp('\\b'+st+'\\b'); o.classname=o.classname ? o.classname.replace(reg,''):''; }, addevent:function(o,t,fn)//注册事件 { return o.addeventlistener ? o.addeventlistener(t,fn,false):o.attachevent('on'+t,fn); }, showselect:function()//显示下拉框列表 { var this=this; var inow=0; this.addevent(document,'click',function(){ for(var i=0;i0) { var this=this; for(var i=0;i