让图片在网页中自动更换的方法
<p><html> <br /> <head> <br /> <title>宿迁电脑技术网欢迎您!--www.sq01.cn--</title> <br /> <meta http-equiv="Content-Type" content="text/html; charset=gb2312"> <br /> <!-- --> <br /> <script LANGUAGE="JavaScript"> <br /> <!-- Hide from JavaScript-Impaired Browsers <br /> number_of_sponsors=3; <br /> var sctr=0; <br /> var halt=0; <br /> var isn=new Array(); <br /> for (i=0;i<number_of_sponsors;i++){ <br /> isn<i>=new Image(); <br /> } <br /> <br /> isn.src="01.jpg"; <br /> isn.src="02.jpg"; <br /> isn.src="03.jpg"; <br /> <br /> function rotateIt(){ <br /> if (halt!=1){ <br /> sctr++; <br /> if (sctr>number_of_sponsors-1){ <br /> sctr=0; <br /> } <br /> document.sponsor.src=isn.src; <br /> setTimeout("rotateIt()",1000); <br /> } <br /> } <br /> <br /> function doIt(){ <br /> halt=1; <br /> location.href=durl; <br /> } <br /> <br /> function dispIt(){ <br /> parent.window.status=durl; <br /> } <br /> // End Hiding --> <br /> </script> <br /> </head> <br /> <br /> <body bgcolor="#FFFFFF" leftmargin="0" topmargin="0"> <br /> <img src="01.jpg" name="sponsor" border="0" height="100%" width="100%"> <br /> <script LANGUAGE="JavaScript"> <br /> <!-- Hide JavaScript from Java-Impaired Browsers <br /> sctr=0; <br /> rotateIt(); <br /> // End Hiding --> <br /> </script> <br /> </body> <br /> </html> </p><p> </p><p>[此帖子已被 灰儿 在 2007-12-20 11:15:52 编辑过]
页:
[1]