几张图片在一个框里面滚动,鼠标放在图片上滚动就停止,鼠标点击小图随即能够打开大图,这样的代码是个什么样的?
參考答案:戈麦网动态图片广告代码
<!-- 动态图开始 -->
<script language=JavaScript>
var imgUrl=new Array();
var imgLink=new Array();
var adNum=0;
imgUrl[1]="";
imgLink[1]=";&catid=117";
imgUrl[2]="";
imgLink[2]=";&catid=200";
imgUrl[3]="";
imgLink[3]=";&catid=189";
imgUrl[4]="";
imgLink[4]=";&catid=200";
imgUrl[5]="";
imgLink[5]=";&catid=188";
var imgPre=new Array();
var j=0;
for (i=1;i<=5;i++) {
if( (imgUrl[i]!="") && (imgLink[i]!="") ) {
j++;
} else {
break;
}
}
function playTran(){
if (document.all)
imgInit.filters.revealTrans.play();
}
var key=0;
function nextAd(){
if(adNum<j)adNum++ ;
else adNum=1;
if( key==0 ){
key=1;
} else if (document.all){
imgInit.filters.revealTrans.Transition=6;
imgInit.filters.revealTrans.apply();
playTran();
}
document.images.imgInit.src=imgUrl[adNum];
theTimer=setTimeout("nextAd()", 3000);
}
function goUrl(){
jumpUrl=imgLink[adNum];
jumpTarget='_blank';
if (jumpUrl != ''){
if (jumpTarget != '')
window.open(jumpUrl,jumpTarget);
else
location.href=jumpUrl;
}
}
</script>
<a href="javascript:goUrl()"><img style="FILTER: revealTrans(duration=2,transition=20);border-color:black;color:#000000" src="javascript:nextAd()" width=180 height=180 border=1 class=b1 name=imgInit></a>
<!-- 动态图结束 -->