以下代码放到<head></head>之间
<script language="javascript">
var imgUrl=new Array();
var imgLink=new Array();
var adNum=0;
imgUrl[1]="../images/paimai/pm08011515453474.jpg";
imgLink[1]="../images/paimai/pm08011515453474.jpg";
imgUrl[2]="../images/paimai/pm08011515464070.jpg";
imgLink[2]="../images/paimai/pm08011515464070.jpg";
imgUrl[3]="../images/paimai/pm0801151547233.jpg";
imgLink[3]="../images/paimai/pm0801151547233.jpg";
imgUrl[4]="../images/paimai/pm08011515496508.jpg";
imgLink[4]="../images/paimai/pm08011515496508.jpg";
imgUrl[5]="../images/paimai/pm0801151550603.jpg";
imgLink[5]="../images/paimai/pm0801151550603.jpg";
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()",4000); //4秒切换一下
}
function goUrl(){
jumpUrl=imgLink[adNum];
jumpTarget='_blank';
if (jumpUrl != ''){
if (jumpTarget != '')
window.open(jumpUrl,jumpTarget);
else
location.href=jumpUrl;
}
}
</script>
2。以下代码放到<body></body>之间,运行即可var imgUrl=new Array();
var imgLink=new Array();
var adNum=0;
imgUrl[1]="../images/paimai/pm08011515453474.jpg";
imgLink[1]="../images/paimai/pm08011515453474.jpg";
imgUrl[2]="../images/paimai/pm08011515464070.jpg";
imgLink[2]="../images/paimai/pm08011515464070.jpg";
imgUrl[3]="../images/paimai/pm0801151547233.jpg";
imgLink[3]="../images/paimai/pm0801151547233.jpg";
imgUrl[4]="../images/paimai/pm08011515496508.jpg";
imgLink[4]="../images/paimai/pm08011515496508.jpg";
imgUrl[5]="../images/paimai/pm0801151550603.jpg";
imgLink[5]="../images/paimai/pm0801151550603.jpg";
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()",4000); //4秒切换一下
}
function goUrl(){
jumpUrl=imgLink[adNum];
jumpTarget='_blank';
if (jumpUrl != ''){
if (jumpTarget != '')
window.open(jumpUrl,jumpTarget);
else
location.href=jumpUrl;
}
}
</script>
<div align="center">
<img style="FILTER:progid:DXImageTransform.Microsoft.RevealTrans (duration=1,transition=3); border-color:#fd0404;color:#fd0404;margin-bottom:-5px; cursor: hand;"
height=116 width=200 border=0 name=imgInit onclick=goUrl()><script language=javascript>nextAd()</script>
</div>
<img style="FILTER:progid:DXImageTransform.Microsoft.RevealTrans (duration=1,transition=3); border-color:#fd0404;color:#fd0404;margin-bottom:-5px; cursor: hand;"
height=116 width=200 border=0 name=imgInit onclick=goUrl()><script language=javascript>nextAd()</script>
</div>