/***********幻灯*****************/ auto=null; timer=null; var focus=new function(); focus.prototype={ init:function(){ //默认动画频率 this.atime=this.atime || 10; //默认间隔 this.stime=this.stime || 5000; //图片容器 this.oimg=document.getelementbyid('focus_m').getelementsbytagname("ul")[0]; this.oimgli=this.oimg.getelementsbytagname("li"); //左右按钮 this.ol=document.getelementbyid('focus_l'); this.or=document.getelementbyid('focus_r'); //创建文字容器 this.createtextdom(); //默认第一帧 this.target=0; //开始动画 this.automove(); //鼠标 this.oaction(); }, createtextdom:function(){ var that=this; //创建文字容器 this.otext=document.createelement("div"); this.otext.classname="focus_s"; var ul=document.createelement('ul'); var frag=document.createdocumentfragment(); for (var i=0;i100) { clearinterval(that.timer); }else { for (var i=0;i=w) { clearinterval(marqueetime); var t1=document.createelement('li'); var t2=o.getelementsbytagname('li')[0]; t1.innerhtml=t2.innerhtml; o.appendchild(t1); o.removechild(t2); o.style.marginleft=0; }else { o.style.marginleft='-'+tt+'px'; tt+=math.ceil((w-tt)*0.1); }; }else { if (tt<=0) { clearinterval(marqueetime); o.style.marginleft=0; }else { o.style.marginleft='-'+tt+'px'; tt=math.floor(0.9*tt); }; } }; marqueetime=setinterval(set,atime); }; if (li.length<7) { l.style.display=r.style.display='none' }else { r.onclick=function(){ gonext(); }; l.onclick=function(){ goprev(); }; }; }; window.onload=function(){ focusrun.init(); marquee(); };