求高手帮忙,以下JS在IE6 IE7正常运行,IE8和FF无法显示
varimgWidth=250;//图片宽varimgHeight=178;//图片varTimeOut=5000;//每张图切换时间(单位毫秒);varimgUrl=n...
var imgWidth=250; //图片宽
var imgHeight=178; //图片
var TimeOut=5000; //每张图切换时间 (单位毫秒);
var imgUrl=new Array();
var imgLink=new Array();
var imgtext=new Array();
var adNum=0;
imgUrl[1]='pic/i01.jpg';
imgtext[1]='1111';
imgLink[1]='#';
imgUrl[2]='pic/i02.jpg';
imgtext[2]='2222';
imgLink[2]='#';
imgUrl[3]='pic/i03.jpg';
imgtext[3]='333';
imgLink[3]='#';
function changeimg(n)
{
adNum=n;
window.clearInterval(theTimer);
adNum=adNum-1;
nextAd();
}
function goUrl(){
window.open(imgLink[adNum],'_blank');
}
{
var count=0;
for (i=1;i<imgUrl.length;i++) {
if( (imgUrl[i]!="") && (imgLink[i]!="")&&(imgtext[i]!="")) {
count++;
} else {
break;
}
}
function playTran(){
if (document.all)
imgInit.filters.revealTrans.play();
}
var key=0;
function nextAd(){
if(adNum<count)adNum++ ;
else adNum=1;
if( key==0 ){
key=1;
} else if (document.all){
imgInit.filters.revealTrans.Transition=23;
imgInit.filters.revealTrans.apply();
playTran();
}
document.images.imgInit.src=imgUrl[adNum];
document.images.imgInit.alt=imgtext[adNum];
document.getElementById('linkx').innerHTML=imgtext[adNum];
theTimer=setTimeout("nextAd()", TimeOut);
}
document.write('<a target=_self href="javascript:goUrl()"><img style="FILTER: revealTrans(duration=1,transition=5);" src="javascript:nextAd()" width='+imgWidth+' height='+imgHeight+' border=0 vspace="0" name="imgInit"></a>');
document.write('<div class="pyy"><div class="pyb"></div>');
document.write('<div class="pyf"><a target=_self href="javascript:goUrl()" class="bai"><font id="linkx">'+imgtext[i]+'</font></a></div></div>');
} 展开
var imgHeight=178; //图片
var TimeOut=5000; //每张图切换时间 (单位毫秒);
var imgUrl=new Array();
var imgLink=new Array();
var imgtext=new Array();
var adNum=0;
imgUrl[1]='pic/i01.jpg';
imgtext[1]='1111';
imgLink[1]='#';
imgUrl[2]='pic/i02.jpg';
imgtext[2]='2222';
imgLink[2]='#';
imgUrl[3]='pic/i03.jpg';
imgtext[3]='333';
imgLink[3]='#';
function changeimg(n)
{
adNum=n;
window.clearInterval(theTimer);
adNum=adNum-1;
nextAd();
}
function goUrl(){
window.open(imgLink[adNum],'_blank');
}
{
var count=0;
for (i=1;i<imgUrl.length;i++) {
if( (imgUrl[i]!="") && (imgLink[i]!="")&&(imgtext[i]!="")) {
count++;
} else {
break;
}
}
function playTran(){
if (document.all)
imgInit.filters.revealTrans.play();
}
var key=0;
function nextAd(){
if(adNum<count)adNum++ ;
else adNum=1;
if( key==0 ){
key=1;
} else if (document.all){
imgInit.filters.revealTrans.Transition=23;
imgInit.filters.revealTrans.apply();
playTran();
}
document.images.imgInit.src=imgUrl[adNum];
document.images.imgInit.alt=imgtext[adNum];
document.getElementById('linkx').innerHTML=imgtext[adNum];
theTimer=setTimeout("nextAd()", TimeOut);
}
document.write('<a target=_self href="javascript:goUrl()"><img style="FILTER: revealTrans(duration=1,transition=5);" src="javascript:nextAd()" width='+imgWidth+' height='+imgHeight+' border=0 vspace="0" name="imgInit"></a>');
document.write('<div class="pyy"><div class="pyb"></div>');
document.write('<div class="pyf"><a target=_self href="javascript:goUrl()" class="bai"><font id="linkx">'+imgtext[i]+'</font></a></div></div>');
} 展开
2个回答
2010-12-17
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询