图片幻灯片显示
鼠标指上图片时,图片停止变换,当鼠标移开后又继续变换:
<html>
<body>
aaa
<script language="JavaScript">
<!--
function objSP_Article() {this.ImgUrl=""; this.LinkUrl=""; this.Title="";}
function SlidePic_Article(_id) {this.ID=_id; this.Width=0;this.Height=0; this.TimeOut=5000; this.Effect=23; this.TitleLen=0; this.PicNum=-1; this.Img=null; this.AllPic=new Array(); this.Add=SlidePic_Article_Add; this.Show=SlidePic_Article_Show; this.LoopShow=SlidePic_Article_LoopShow;}
function SlidePic_Article_Add(_SP) {this.AllPic[this.AllPic.length] = _SP;}
function SlidePic_Article_Show() {
if(this.AllPic[0] == null) return false;
document.write("<div align='center'><img id='Img_" + this.ID + "' style='width:" + this.Width + "px; height:" + this.Height + "px; filter: revealTrans(duration=2,transition=23);' src='javascript:null' border='0' >");
document.write("</div>");
this.Img = document.getElementById("Img_" + this.ID);
this.LoopShow();
}
function SlidePic_Article_LoopShow() {
if(this.PicNum<this.AllPic.length-1) this.PicNum++ ;
else this.PicNum=0;
this.Img.filters.revealTrans.Transition=this.Effect;
this.Img.filters.revealTrans.apply();
this.Img.src=this.AllPic[this.PicNum].ImgUrl;
this.Img.filters.revealTrans.play();
timer=setTimeout(this.ID+".LoopShow()",this.TimeOut);
this.Img.onmouseover=function(){clearTimeout(timer);}
this.Img.onmouseout=function(){timer=setTimeout("SlidePic_271.LoopShow()",this.TimeOut);}
}
function clearT(){
}
//-->
</script>
<script language=JavaScript>
<!--
var SlidePic_271 = new SlidePic_Article("SlidePic_271");
SlidePic_271.Width = 300;
SlidePic_271.Height = 225;
SlidePic_271.TimeOut = 5000;
SlidePic_271.Effect = 23;
SlidePic_271.TitleLen = 0;
var oSP = new objSP_Article();
oSP.ImgUrl = "/upimg/<%=rs("pic1")%>";
SlidePic_271.Add(oSP);
var oSP = new objSP_Article();
oSP.ImgUrl = "/upimg/<%=rs("pic2")%>";
SlidePic_271.Add(oSP);
var oSP = new objSP_Article();
oSP.ImgUrl = "/upimg/<%=rs("pic3")%>";
SlidePic_271.Add(oSP);
SlidePic_271.Show();
//-->
</script>
</body>
</html>
<body>
aaa
<script language="JavaScript">
<!--
function objSP_Article() {this.ImgUrl=""; this.LinkUrl=""; this.Title="";}
function SlidePic_Article(_id) {this.ID=_id; this.Width=0;this.Height=0; this.TimeOut=5000; this.Effect=23; this.TitleLen=0; this.PicNum=-1; this.Img=null; this.AllPic=new Array(); this.Add=SlidePic_Article_Add; this.Show=SlidePic_Article_Show; this.LoopShow=SlidePic_Article_LoopShow;}
function SlidePic_Article_Add(_SP) {this.AllPic[this.AllPic.length] = _SP;}
function SlidePic_Article_Show() {
if(this.AllPic[0] == null) return false;
document.write("<div align='center'><img id='Img_" + this.ID + "' style='width:" + this.Width + "px; height:" + this.Height + "px; filter: revealTrans(duration=2,transition=23);' src='javascript:null' border='0' >");
document.write("</div>");
this.Img = document.getElementById("Img_" + this.ID);
this.LoopShow();
}
function SlidePic_Article_LoopShow() {
if(this.PicNum<this.AllPic.length-1) this.PicNum++ ;
else this.PicNum=0;
this.Img.filters.revealTrans.Transition=this.Effect;
this.Img.filters.revealTrans.apply();
this.Img.src=this.AllPic[this.PicNum].ImgUrl;
this.Img.filters.revealTrans.play();
timer=setTimeout(this.ID+".LoopShow()",this.TimeOut);
this.Img.onmouseover=function(){clearTimeout(timer);}
this.Img.onmouseout=function(){timer=setTimeout("SlidePic_271.LoopShow()",this.TimeOut);}
}
function clearT(){
}
//-->
</script>
<script language=JavaScript>
<!--
var SlidePic_271 = new SlidePic_Article("SlidePic_271");
SlidePic_271.Width = 300;
SlidePic_271.Height = 225;
SlidePic_271.TimeOut = 5000;
SlidePic_271.Effect = 23;
SlidePic_271.TitleLen = 0;
var oSP = new objSP_Article();
oSP.ImgUrl = "/upimg/<%=rs("pic1")%>";
SlidePic_271.Add(oSP);
var oSP = new objSP_Article();
oSP.ImgUrl = "/upimg/<%=rs("pic2")%>";
SlidePic_271.Add(oSP);
var oSP = new objSP_Article();
oSP.ImgUrl = "/upimg/<%=rs("pic3")%>";
SlidePic_271.Add(oSP);
SlidePic_271.Show();
//-->
</script>
</body>
</html>