hrx123123 hrx123123
关注数: 12 粉丝数: 15 发帖数: 633 关注贴吧数: 20
焦点图滚动特效实现不了,求大神帮帮我吧~ <SCRIPT> var imgWidth=1002; var imgHeight=400; var TimeOut=6000; var imgAlt=new Array(); var imgUrl=new Array(); var imgLink=new Array(); var imgStyle=''; var focustextStyle='height:25px; line-height:25px; text-align:center;'; var textClass=''; imgUrl[1]='images/jin2.jpg'; imgLink[1]='/'; imgAlt[1]='你好你好'; imgUrl[2]='/images/jin2.jpg'; imgLink[2]='/'; imgAlt[2]='你好你好'; imgUrl[3]='/images/ban2.jpg'; imgLink[3]='/'; imgAlt[3]='你好你好'; imgUrl[4]='/images/ban2.jpg'; imgLink[4]='/'; imgAlt[4]='你好你好'; var count=0; for (i=1;i<=imgUrl.length;i++) { if( (imgUrl[i]!="") && (imgLink[i]!="")&&(imgAlt[i]!="")&&(imgUrl[i]!=null) && (imgLink[i]!=null)&&(imgAlt[i]!=null) ) {count++;} else {break;} } function change(i){ window.clearInterval(theTimer); switch(browser){ //ie6 以上版本 case 1 : adNum = i; nextAd_1(); break; //其他浏览器 case 2 : adNum = i-1; nextAd_2(); break; } } /* nextAd_1 */ function nextAd_1() { if(bStart == 0) { bStart = 1; theTimer=setTimeout('nextAd_1()', TimeOut); return; } else { oTransContainer.filters[0].Apply(); for (var i=1;i<=count;i++){ //document.getElementById('focus_summary'+i).style.display="none"; document.images['oDIV'+i].style.display = "none"; } //document.getElementById('focus_summary'+adNum).style.display="block"; //document.getElementById('oDIV'+adNum).href=imgLink[adNum]; //document.getElementById('oDIV'+adNum).alt=imgAlt[adNum]; document.images['oDIV'+adNum].style.display = "block"; //document.getElementById('focus_summary').innerHTML=imgSummary[adNum]; oTransContainer.filters[0].Play(duration=2); if(adNum+1 > count) adNum = 1; else adNum++; } theTimer=setTimeout("nextAd_1()", TimeOut); } /* nextAd_2 */ function nextAd_2(){ if(adNum < count) adNum++; else adNum = 1; document.images.imgInit.src=imgUrl[adNum]; document.images.imgInit.alt=imgAlt[adNum]; for (var i=1;i<=count;i++){ //document.getElementById('focus_summary'+i).style.display="none"; } //document.getElementById('focus_summary'+adNum).style.display="none"; //document.getElementById('focus_summary').innerHTML=imgSummary[adNum]; document.getElementById('b'+adNum).href=imgLink[adNum]; document.getElementById('b'+adNum).alt=imgAlt[adNum]; theTimer=setTimeout("nextAd_2()", TimeOut); } /* show_1 */ function show_1(){ document.write('<div id="focuse">'); document.write('<div id="oTransContainer" style="FILTER: progid:DXImageTransform.Microsoft.Wipe(GradientSize=1.0, wipeStyle=0, motion=reverse); WIDTH: '+imgWidth+'; HEIGHT: '+imgHeight+'">'); //图片 document.write('<img id="oDIV1" src="'+imgUrl[1]+'" width='+imgWidth+' height='+imgHeight+' border=0 align="absmiddle" alt="'+imgAlt[1]+'" style='+imgStyle+'>'); for(var i=2;i<=count;i++){ document.write('<img id="oDIV'+i+'" src="'+imgUrl[i]+'" width='+imgWidth+' height='+imgHeight+' border=0 style="DISPLAY: none" alt="'+imgAlt[i]+'" style='+imgStyle+'>'); } document.write('</div>'); //document.write('<div id="focustext" style="'+focustextStyle+'">'+imgtext[1]+'</div>'); document.write('</div>'); //document.getElementById('f_link').href=imgLink[1]; //document.getElementById('blank_pic').alt=imgAlt[1]; nextAd_1(); } /* show_2 */ function show_2(){ document.write('<div id="focuse">'); document.write('<img src="'+imgUrl[1]+'" name="imgInit" width='+imgWidth+' height='+imgHeight+' border=0 alt="'+imgAlt[1]+'" style='+imgStyle+'>'); //document.write('<div id="focustext" style="'+focustextStyle+'">'+imgtext[1]+'</div>'); document.write('</div>'); //document.getElementById('f_link').href=imgLink[1]; //document.getElementById('blank_pic').alt=imgAlt[1]; nextAd_2(); } /* goUrl() */ function goUrl(){ window.open(imgLink[adNum],'_blank'); } /* playTran() */ function playTran(){ if (document.all) imgInit.filters.revealTrans.play(); } </SCRIPT>
1 下一页