这段代码,在IE6上没有问题,IE7上有问题.谁帮忙解决一下.
<table height= "100 " cellspacing= "0 " cellpadding= "0 " width= "686 " border= "0 ">
<tr>
<td valign= "top ">
<script language= "JavaScript ">
var imgUrl=new Array();
var imgLink=new Array();
var adNum=0;
imgUrl[1]= "/images/ban1.jpg ";
imgLink[1]= "# ";
imgUrl[2]= "/images/ban2.jpg ";
imgLink[2]= "# ";
imgUrl[3]= "/images/ban3.jpg ";
imgLink[3]= "# ";
var imgPre=new Array();
var j=0;
for (i=1;i <=3;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=30;
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= "javascript:goUrl() ">
<img style= "FILTER: revealTrans(duration=2,transition=20); " height= "100 " alt= " " src= "javascript:nextAd(); " width= "686 " border= "0 " name= "imgInit "> </a> </td>
</tr>
</table>
[解决办法]
<a href= "# " onclick= "jump2url(this); ">
<img border= "0 " width= "600 " style= "FILTER: revealTrans(duration=2,transition=20) " src= "javascript:nextAd() " name= "imgInit " /> </a>
<div style= "padding:3px;line-height:150% "> <a href= " " onmouseover= "this.title=this.innerHTML " id= "Hter " > </a> </div>
<script>
var I = new Array();
var H = new Array();
var T = new Array();
var preloadedimages = new Array();
var adNum = 0;
for (i=0;i < I.length;i++){
preloadedimages[i]=new Image();
preloadedimages[i].src=I[i];
}
function setTransition(){
if (document.all){
imgInit.filters.revealTrans.Transition=Math.floor(Math.random()*23);
imgInit.filters.revealTrans.apply();
}
}
function playTransition(){
if (document.all)
imgInit.filters.revealTrans.play();
}
function nextAd(){
if(adNum < I.length-1)
adNum++ ;
else
adNum = 0;
setTransition();
document.images.imgInit.src=I[adNum];
document.images.imgInit.alt=T[adNum];
document.images.imgInit.title=T[adNum];
document.all.Hter.innerHTML=T[adNum];
document.all.Hter.href=H[adNum];
playTransition();
theTimer = window.setTimeout( "nextAd() ", 1000);
}
function jump2url(o){
jumpUrl = H[adNum];
jumpTarget = '_blank ';
if(jumpUrl != ' ')
{
o.target=jumpTarget;
o.href=jumpUrl
}
}
I[0] = "http://zi.csdn.net/net300-60.gif ";
H[0] = "program/ShortcutTargetTransfer.asp?href=../Documents/jydt/2006612111854/1139A5CC339.htm ";
T[0] = "fff ";
I[1] = "http://dotnet.aspx.cc/Images/logoSite.gif ";
H[1] = "program/ShortcutTargetTransfer.asp?href=../Documents/jydt/2006612111854/113991E9955.htm ";
T[1] = "ffff ";
I[2] = "http://dotnet.aspx.cc/Images/banner.gif ";
H[2] = "program/ShortcutTargetTransfer.asp?href=../Documents/jydt/2006612111854/1139513509E.htm ";
T[2] = "ffff 加强暑… ";
nextAd()
</script>