请分析一下代码 哪里出现了错误? 如何进行修改? 如何把路径设置成自己主机路径?
<SCRIPT>varwidths=350;//图片宽度varheights=225;//图片高度varcounts=2;//图片数量img1=newImage();im...
<SCRIPT>
var widths=350; //图片宽度
var heights=225; //图片高度
var counts=2; //图片数量
img1=new Image ();img1.src="河北大学工商学院.files/picture7.jpg" ;
img2=new Image ();img2.src="河北大学工商学院.files/e49e01226fe330bf4723e829.jpg";
url1=new Image ();url1.src='http://www.layzo.com';
url2=new Image ();url2.src='http://www.layzo.com';
var nn=1;
var key=0;
function change_img()
{if(key==0){key=1;}
else if(document.all)
{document.getElementByIdx_x("pic").filters.revealTrans.Transition=Math.floor(Math.random()*23);document.getElementByIdx_x("pic").filters.revealTrans.Apply();document.getElementByIdx_x("pic").filters.revealTrans.Play();}
eval_r('document.getElementByIdx_x("pic").src=img'+nn+'.src');
eval_r('document.getElementByIdx_x("url").href=url'+nn+'.src');
for (var i=1;i<=counts;i++){document.getElementByIdx_x("xxjdjj"+i).className='axx';}
document.getElementByIdx_x("xxjdjj"+nn).className='bxx';
nn++;if(nn>counts){nn=1;}
tt=setTimeout('change_img()',4000);}
function changeimg(n){nn=n;window.clearInterval(tt);change_img();}
document.write('<style>');
document.write('.axx{padding:1px 7px;border-left:#cccccc 1px solid;}');
document.write('a.axx:link,a.axx:visited{text-decoration:none;color:#fff;line-height:12px;font:9px sans-serif;background-color:#666;}');
document.write('a.axx:active,a.axx:hover{text-decoration:none;color:#fff;line-height:12px;font:9px sans-serif;background-color:#999;}');
document.write('.bxx{padding:1px 7px;border-left:#cccccc 1px solid;}');
document.write('a.bxx:link,a.bxx:visited{text-decoration:none;color:#fff;line-height:12px;font:9px sans-serif;background-color:#D34600;}');
document.write('a.bxx:active,a.bxx:hover{text-decoration:none;color:#fff;line-height:12px;font:9px sans-serif;background-color:#D34600;}');
document.write('</style>');
document.write('<div style="width:'+widths+'px;height:'+heights+'px;overflow:hidden;text-overflow:clip;">');
document.write('<div><a id="url" target="_blank"><img id="pic" style="filter: revealTrans(duration=2,Transition=5)" width='+widths+' height='+heights+' border="0" /></a></div>');
document.write('<div style="filter:alpha(style=1,opacity=10,finishOpacity=80);background: #888888;width:100%-2px;text-align:right;top:-12px;position:relative;margin:1px;height:12px;padding-top:1.5px !important;padding-top:0px;margin:0px;border:0px;">');
for(var i=1;i<counts+1;i++){document.write('<a href="javascript:changeimg('+i+');" id="xxjdjj'+i+'" class="axx" target="_self">'+i+'</a>');}
document.write('</div></div>');
change_img();
</SCRIPT> 展开
var widths=350; //图片宽度
var heights=225; //图片高度
var counts=2; //图片数量
img1=new Image ();img1.src="河北大学工商学院.files/picture7.jpg" ;
img2=new Image ();img2.src="河北大学工商学院.files/e49e01226fe330bf4723e829.jpg";
url1=new Image ();url1.src='http://www.layzo.com';
url2=new Image ();url2.src='http://www.layzo.com';
var nn=1;
var key=0;
function change_img()
{if(key==0){key=1;}
else if(document.all)
{document.getElementByIdx_x("pic").filters.revealTrans.Transition=Math.floor(Math.random()*23);document.getElementByIdx_x("pic").filters.revealTrans.Apply();document.getElementByIdx_x("pic").filters.revealTrans.Play();}
eval_r('document.getElementByIdx_x("pic").src=img'+nn+'.src');
eval_r('document.getElementByIdx_x("url").href=url'+nn+'.src');
for (var i=1;i<=counts;i++){document.getElementByIdx_x("xxjdjj"+i).className='axx';}
document.getElementByIdx_x("xxjdjj"+nn).className='bxx';
nn++;if(nn>counts){nn=1;}
tt=setTimeout('change_img()',4000);}
function changeimg(n){nn=n;window.clearInterval(tt);change_img();}
document.write('<style>');
document.write('.axx{padding:1px 7px;border-left:#cccccc 1px solid;}');
document.write('a.axx:link,a.axx:visited{text-decoration:none;color:#fff;line-height:12px;font:9px sans-serif;background-color:#666;}');
document.write('a.axx:active,a.axx:hover{text-decoration:none;color:#fff;line-height:12px;font:9px sans-serif;background-color:#999;}');
document.write('.bxx{padding:1px 7px;border-left:#cccccc 1px solid;}');
document.write('a.bxx:link,a.bxx:visited{text-decoration:none;color:#fff;line-height:12px;font:9px sans-serif;background-color:#D34600;}');
document.write('a.bxx:active,a.bxx:hover{text-decoration:none;color:#fff;line-height:12px;font:9px sans-serif;background-color:#D34600;}');
document.write('</style>');
document.write('<div style="width:'+widths+'px;height:'+heights+'px;overflow:hidden;text-overflow:clip;">');
document.write('<div><a id="url" target="_blank"><img id="pic" style="filter: revealTrans(duration=2,Transition=5)" width='+widths+' height='+heights+' border="0" /></a></div>');
document.write('<div style="filter:alpha(style=1,opacity=10,finishOpacity=80);background: #888888;width:100%-2px;text-align:right;top:-12px;position:relative;margin:1px;height:12px;padding-top:1.5px !important;padding-top:0px;margin:0px;border:0px;">');
for(var i=1;i<counts+1;i++){document.write('<a href="javascript:changeimg('+i+');" id="xxjdjj'+i+'" class="axx" target="_self">'+i+'</a>');}
document.write('</div></div>');
change_img();
</SCRIPT> 展开
2010-11-22
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询