- 爱易网页
-
JavaSript
- 这段代码,在IE6上没有有关问题,IE7上有有关问题.哪位高手帮忙解决一下
日期:2014-05-16 浏览次数:20443 次
这段代码,在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>