⾃动轮播图html代码不⽤js,不⽤写html排版标签的图⽚轮播js 1.[代码][JavaScript]代码
// 易寻团队 2013-01-01
function IMGS(id,w,h,da,c){
this.w=w;
this.h=h;
this.da=da;
this.l=da.length;
this.html="";
this.id=id;
this.child={img:[],div:[]};
<=0;
<=0;
this.m=10;
this.pr=null;
this.time=false;
if(typeof c =="undefined"){
this.c={bg:"#600",color:"#fff",cbg:"#eee",ccolor:"#600",bc:"#ccc",step:6000}
}else{
this.c=c;
}
this.step;
this.init();
}
IMGS.prototype={
init:function(){
document.writeln('
var ateElement("div");
Bdiv.style.cssText="position:absolute;right:10px;bottom:1px;height:25px;z-index:100;";
this.$(this.id).appendChild(Bdiv);
var self=this;
for(var i=this.l-1;i>=0;i--){
var ateElement("img");
var ateElement("div");
img.width=this.w;
img.height=this.h;
img.border="0";
img.src=this.da[i].src;
img.alt=this.da[i].name;
div.innerHTML=(i+1);
div.style.cssText="float:right;width:20px;height:18px;margin-right:5px;border:1px solid "+bc+";line-height:18px;text-align:center;cursor:default";
if(i>0){
div.style.cssText+="background:"+bg+";color:"+lor+";";
}else{
div.style.cssText+="background:"+bg+";color:"+lor+";";
}
if(typeof this.da[i].link !=""){
var ateElement("a");
a.href=this.da[i].link;
a.appendChild(img);
this.child.img[i]=a;
this.$(this.id).appendChild(a);
}else{
this.child.img[i]=img;
this.$(this.id).appendChild(img);
}
this.child.img[i].style.cssText+=";position:absolute;left:0px;top:0px;z-index:1;display:none";
this.child.div[i]=div;
div.οnmοuseοver=function(){
self.Cl(parseInt(this.innerHTML)-1);
}
if(this.l>0)this.pr=this.child.img[0];
if(this.l>1)Bdiv.appendChild(div);
}
this.Go();
},
Go:function(){
var self=this;
for(var i=0;i
this.child.img[i].style.zIndex="1";
this.child.div[i].style.bg;
this.child.div[i].lor;
}
if(this.pr!=null)this.pr.style.zIndex="10";
this.pr=this.child.];
this.m=10;
with(this.child.].style){filter='alpha(opacity=10)';opacity=0.1;display="";zIndex="20";} this.None(self,this.child.]);
with(this.child.].style){bg;lor;}
<++;
==this.=0;
if(this.l>1)this.time=setTimeout(function(){self.Go()},this.step);
},
None:function(self,tt){
with(tt.style){filter='alpha(opacity='+self.m+')';opacity=(self.m/100);}
self.m+=5;
js实现轮播图最简代码if(self.m<101)
<=setTimeout(function(){self.None(self,tt)},10);
else
);
},
Cl:function(cr){
);
clearTimeout(this.time);
<=cr;
this.Go();
},
$:function(id){ElementById(id);}
}

版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系QQ:729038198,我们将在24小时内删除。