多图片每次变化的效果不同的js效果

类别:网站制作 点击:0 评论:0 推荐:

<script language=JavaScript>
var imgUrl=new Array();
var imgLink=new Array();
var adNum=0;
imgUrl[1]="http://www.smallrain.net/jsimg/1.jpg";
imgLink[1]="#1";
imgUrl[2]="http://www.smallrain.net/jsimg/2.jpg";
imgLink[2]="#2";
imgUrl[3]="http://www.smallrain.net/jsimg/3.jpg";
imgLink[3]="#3";
imgUrl[4]="http://www.smallrain.net/jsimg/4.jpg";
imgLink[4]="#4";

imgUrl[5]="http://www.smallrain.net/jsimg/2.jpg";
imgLink[5]="#2";
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){
  document.imgInit.filters[0].play();
 }
}

function nextAd(){
 if(adNum<j)adNum++ ;
 else adNum=1;
 
 if (document.all){
  document.imgInit.filters[0].Transition=26;
  document.imgInit.filters[0].apply();
 }
 document.images.imgInit.src=imgUrl[adNum];
 playTran();
 theTimer=setTimeout("nextAd()", 6000);
}


function goUrl(){
 jumpUrl=imgLink[adNum];
 jumpTarget='_blank';
 if (jumpUrl != ''){
  if (jumpTarget != '')
   window.open(jumpUrl,jumpTarget);
  else
   location.href=jumpUrl;
 }
}
</script>
<a href="#" onclick="goUrl()" target="_parent"><img style="FILTER:
progid:DXImageTransform.Microsoft.RevealTrans (duration=1,transition=3);
; border-color:#000000;color:#000000;margin-bottom:-5px" src="javascript:nextAd()" height=100 width=150 border=0 name=imgInit></a>

本文地址:http://com.8s8s.com/it/it31056.htm