就是把表单中的img1的地址赋值为images/01.gif。
我这里有个图片循环转换的代码:
<%tupian1="images/01.gif"
tupian2="images/02.gif"
tupian3="images/03.gif"
tupian4="images/04.gif"
tupian5="images/05.gif"
tupian6="images/06.gif"
tupian1url="index.asp"
tupian2url="index.asp"
tupian3url="index.asp"
tupian4url="index.asp"
tupian5url="index.asp"
tupian6url="index.asp"%>
<script language=javascript>
var imgUrl=new Array();
var imgLink=new Array();
var adNum=0;
imgLink[2]="<%=tupian2url%>";
imgLink[1]="<%=tupian1url%>";
imgLink[3]="<%=tupian3url%>";
imgLink[4]="<%=tupian4url%>";
imgUrl[2]="<%=tupian2%>";
imgUrl[1]="<%=tupian1%>";
imgUrl[3]="<%=tupian3%>";
imgUrl[4]="<%=tupian4%>";
var imgPre=new Array();
var j=0;
for (i=0;i<=3;i++) {
if(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=25;
imgInit.filters.revealTrans.apply();
playTran();
}
document.images.imgInit.src=imgUrl[adNum];
jumpUrl=imgLink[adNum];
theTimer=setTimeout("nextAd()", 5200);
}
function goUrl(){
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=6)" src="javascript:nextAd()" width=300 border=0 name=imgInit height="200"></a>