(function(){ window.dom=dom= { addevent:function(s,fn){this.attachevent?this.attachevent('on'+s,fn):this.addeventlistener(s,fn,false);return this;},//添加事件[事件(要去掉前面的on),方法] delevent:function(s,fn){this.detachevent?this.detachevent('on'+s,fn):this.removeeventlistener(s,fn,false);return this;},//删除事件[事件(要去掉前面的on),方法] adddom:function(node,tag,first){var o=node.createelement(tag);first?node.insertbefore(o,node.firstchild):node.appendchild(o);return o;},//创建子节点[节点,要创建的tag,插入位置] deldom:function(node,obj){node.removechild(obj);},//删除子节点[父节点,要删除节点] addimg:function(url){var img=new image();img.src=url;return img;},//创建缓存图片[图片地址] winh:function(){return math.min(document.documentelement.clientheight,document.body.clientheight);},//返回浏览器可用高 mousex:function(event){return (event.pagex || (event.clientx +l(document)));},//返回鼠标的x座标 mousey:function(event){return (event.pagey || (event.clienty +t(document)));}//返回鼠标的y座标 } fun.xcopy(dom,element); })(); window.effect= { //滚动/切屏效果,[id,子容器/孙容器,方向,速度,上按钮,下按钮,分页切换时间,每次切屏的条数] htmlmove:function(id,tag,path,rate,upbt,downbt,pgtime,lis) { var c,mous=false,fg=tag.split('/'),o=$(id),as=o.find(fg[1]),fx=(path=="scrollright"||path=="scrollleft")?"scrollleft":"scrolltop",ow=fx=="scrolltop"?as[0].h():as[0].w(); o.onmouseover=function(){mous=true;};o.onmouseout=function(){mous=false;} if(pgtime==null) { var mx=ow*as.length,mi=0,oldra=rate,os=o.find(fg[0])[0];os.innerhtml+=os.innerhtml; if(upbt){$(upbt).onmousedown=function(){down();rate+=3;};$(upbt).onmouseup=function(){rate=oldra;};} if(downbt){$(downbt).onmousedown=function(){up();rate+=3;};$(downbt).onmouseup=function(){rate=oldra;};} function up(){clearinterval(c);c=setinterval(function(){if(mous){return;}(o[fx]-rate>0)?(o[fx]-=rate):(o[fx]=mx);},30);} function down(){clearinterval(c);c=setinterval(function(){if(mous){return;}(o[fx]+rate0){now--;}else{now=pg-1;o[fx]=pg*pgmx;}pfs((now+1)*pgmx);mx=now*pgmx;ex=setinterval(function(){(o[fx]-rate>mx)?(o[fx]-=rate):o[fx]=mx;if(o[fx]==mx){clearinterval(ex);ex=null;pfscl();}},5);} } } }, //缓冲:id,要设置的图片id,节点移动速度,要移动到的目的支持:['width:100','height:100','left:100','top:100','opacity:100','scrolltop:100','scrollleft:100'],移动完成后回调方法名不支持参数,可选 //如果事件中有opacity属性:则页面样式中要定义:opacity:0.1;filter:alpha(opacity=10); spaceto:function(id,slot,mx,fun) { var o=$(id),over=0,ar=array(),len=mx.length,temp; for(var i=0;iar[i][2]&&(ar[i][1]+=(slot-1));ar[i][5]=true;} clearinterval(window[id+"spaceto"]);window[id+"spaceto"]=setinterval(mov,10); function mov() { for(var i=0;i