一款三张背景图淡入淡出切换,带左右按钮,带小按钮,自动播放,幻灯片上面还带有一个用户登录框。/***********幻灯*****************/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.TextDom(); //默认第一帧 this.target=0; //开始动画 this.autoMove(); //鼠标 this.oAction(); }, TextDom:function(){ var that=this; //创建文字容器 this.oText=document.Element("div"); this.oText.className="focus_s"; var ul=document.Element("ul"); var frag=document.DocumentFragment(); for (var i=0;i" ;="" if="" (i="=0)" li.classname="active" };="" frag.appendchild(li);="" ul.appendchild(frag);="" this.otext.appendchild(ul);="" this.o.insertbefore(this.otext,this.o.firstchild);="" 文字容器绑定动作="" this.otextli="this.oText.getElementsByTagName("li");" },="" automove:function(){="" that="this;" auto="setInterval(function(){that.goNext()},that.sTime);" gonext:function()="" this.target="this.nowIndex();" ?="" this.astep="(this.target-this.nowIndex())*this.step;" this.removeclassname();="" this.otextli[this.target].classname="active" this.startmove();="" goprev:function()="" :="" this.target--;="" startmove:function="" (){="" t="0;" this.timer="" function="" set(){="" (t="">100) { clearInterval(that.timer); }else { for (var i=0;i=w) { clearInterval(marqueeTime); var t1=document.Element("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.οnclick=function(){ goNext(); }; l.οnclick=function(){ goPrev(); }; };};window.οnlοad=function(){ focusRun.init(); marquee();};;i++)>;i++)>
dd: