<meta http-equiv="refresh" content="20; url=±ý³sµ²ºô¶.htm"> <!-- http-equiv="refresh"¡Gªí¥Üºô¶¦Û°Ê§ó·s content="20;......¡Gªí¼È°± 20 ¬í«á¶}©l§ó·s°Ê§@ url=±ý³sµ²ºô¶.htm¡Gªí§ó·s«á¸ü¤Jªººô¶¡A¦pªG¨S¦³³]©w¡Aªí¥Ü«·s¸ü¤Jìºô¶¡C // -->¤W±³oºØ¼gªk¡AIE ©M NS ³£¦³¤ä´©¡A¨º»ò»Ýn´`Àô¼½©ñ®É¡A¥u»Ýn¦b¨C±iºô¶ªº¼ÐÀY ºô¶³]¦n¥¦ªº¤U±iºô¶¦ì§}¤Î¼È°±®É¶¡¡A¨º»ò´N¥i§Î¦¨¤@²Õ´`Àô¼½©ñªººô¶¡C
<SCRIPT> var timer; function LoadNextPage() {location.href="NewPageURL";} function Initialize() {timer=setTimeout("LoadNextPage()",5*1000);} </SCRIPT> <BODY onload="Initialize()"> ...... ¨ä¥Lºô¶¤º®e ...... </BODY> /* 1.¥Î LoadNextPage ¦Ûq¨ç¼Æ¥h¸ü¤J¤U¤@Óºô¶¡C 2.BODY onload="Initialize()" ºô¶¤U¸ü§¹¦¨«h°õ¦æªì©l¤Æ¡C 3.var timer=setTimeout ªí¥Ü¥ÎÅÜ¼Æ timer ¥h«Å§i±Ò¥Î¤@Ӯɶ¡¶¡¹jÅX°Ê¾¹¡C 4.setTimeout() ¤èªkªº²Ä¤@ӰѼƬO¶Ç¤J®É¶¡¨ì®É¡An°õ¦æªº¨ç¼Æ¦WºÙ¦r¦ê¡C 5.setTimeout() ¤èªkªº²Ä¤GӰѼƬO¼È°±ªº²@¬í¼Æ¡A10*1000 ªí¥Ü¼È°± 10 ¬í¡C */¦Ó¤¤Â_³oÓ§ó·s¸ü¤Jªº°Ê§@«h¥i¥H³o»ò¼g¡G
function StopLoadNextPage() {clearTimeout(timer);} /* «Å§i°±¤î¸ü¤J·sºô¶ªº¦Ûq¨ç¼Æ¡Aì²z¬OÉ clearTimeout() ¤èªk²×¤î ®É¶¡¶¡¹jÅX°Ê¾¹ timer ªº¨Ï¥Î¡A¬JµM timer ³Q²×¤î¡A·íµM´N¤£·|¨ì¤F ®É¶¡¥h°õ¦æ LoadNextPage() ªº°Ê§@¡C */¦Ü©ó³oÓ StopLoadNextPage() ©M LoadNextPage() ¤£¦Pªº¬O¡ALoadNextPage ¬O¥Ñ Script ¦Û¦æ±Ò°Êªº¡A¦Ó StopLoadNextPage «h¥²¶·¥æ¥ÑÂsÄýªÌ¾Þ§@¨Ó±Ò°Ê¡C¨Ò¦p §A¥i¥H¥Î³o¼Ëªº HTML ³]©w¡G
<A HREF="#" onclick="StopLoadNextPage();return false;">²×¤î´`Àô</A>¦p¦¹¥un¦b timer ±Ò°Ê LoadNextPage ¤§«e¡AÂsÄýªÌ¥ý«ö¤U [²×¤î´`Àô] ªº link ¡A ¨º»ò¾ã²Õ´`Àôºô¶°Ê§@´N·|³Q°±¤î¤U¨Ó¡C
<frameset rows="50,*"> <frame src="slider.htm" name="Slider" noresize scrolling=no BORDER="0" FRAMEBORDER="NO" FRAMESPACING="0"> <frame src="preview.htm" name="Viewer" noresize scrolling=Auto BORDER="0" FRAMEBORDER="NO" FRAMESPACING="0"> </frameset> <!-- ®Ø¬[²Õ³]©w¶¦WºÙ¡Gloopfrm.htm ±±¨î¶¡Gslider.htm Åã¥Ü¶¡Gpreview.htm // -->slider.htm ¬Ot³d°O¿ý¨Ã±±¨î©Ò¦³ªº´`Àô²Õºô¶¡A¥¦¦b¼½©ñºô¶®É¥²¶·¨Ï²×±¾¦b frame slider ùØ¡A¦Ó preview.htm ¥u¬O¦b frame Viewer ¤¤Åã¥Ü¤@¨Ç¾Þ§@»¡©ú¡A¤@¥¹ ¼½©ñ¶}©l¡A´N·|³Q¨ä¥L¼½©ñºô¶¨ú¥N¡A¦Ü©ó frame Viewer ùتººô¶¡A«h¬O«ö®É¶¡¶¡¹j ¡A¤£°±©â´«ªº¡C
var slideLoader; /* DHTML ºô¶ªì©l¤Æ³]©w */ function Initialize() { slideLoader=parent.frames.Viewer.location; /* ¥ÎÅÜ¼Æ slideLoader °Ñ·Ó®Ø¬[²Õ¤¤ frame Viewer ¸ü¤Jºô¶ª«¥ó«á¡A ´N¥i¥H¥Î slideLoader.href="·sºô¶ªº URL" ªº»yªk¡A ¦b frame Viewer ¤¤¸ü¤J·sºô¶¡C */ /* ...... ¨ä¥L Script ±Ôz ...... */ }
<FORM NAME="setting"> <!-- ... ¨ä¥L TAG ³]©w ... // --> <!-- §â©Ò¦³n´`Àô¼½©ñªººô¶°O¿ý¦b³oÓ Option ¶°¦Xª«¥óªº text ÄÝ©ÊùØ // --> <SELECT NAME="slides"> <OPTION ...>´`Àôºô¶¤@ URL</OPTION> <OPTION ...>´`Àôºô¶¤G URL</OPTION> <OPTION ...>´`Àôºô¶¤T URL</OPTION> <!-- ... ¨ä¥L OPTION ³]©w ... // --> </SELECT> </FORM>·í§A¥Î³o¼Ë¤è¦¡ªº²Õ¦¨§Aªººô¶´`Àô¼½©ñ²Õ«á¡A§A´N¥i¥H¥Î³o¼Ëªº Script ¥h¤@¤@°õ¦æ ¨C¤@¶ªº¸ü¤J¡G
var slideCollect,totalslide; /* ¥Î slideCollect Åܼƥh°Ñ·Óªí³æ slides ùتº option ¶°¦X */ slideCollect=document.forms.setting.elements.slides; /* ´`Àôºô¶¼Æ¶qµ¥©ó option ¶°¦XÁ`¼Æ¶q */ totalslide=slideCollect.length; for (var i=0;i<totalslide;i++) { slideLoader.href=slideCollect[i].text;}
/* ¼½©ñºô¶»¼¼WÅÜ¼Æ */ var nowno=0; function SlideShow() { // ... ¨ä¥L Script ±Ôz ... slideLoader.href=slideCollect[nowno].text; timer=setTimeout("SlideShow()",¼È°±¶¡¹jªº²@¬í¼Æ); nowno++; // ... ¨ä¥L Script ±Ôz ... }¦]¬°¨C°õ¦æ SlideShow() ¤@¦¸¡AsetTimeout() ´N·|³Q³]©w¦A©I¥s¦Û¤v°õ¦æ¤@¦¸¡A ¨Ã¥B»¼¼WÅܼƥ[¤@¡A¦]¦¹´N¯à´`§Çªº¼½©ñ©Ò¦³ªºÀɮסC
<FORM NAME="setting"> <!-- ... ¨ä¥L TAG ³]©w ... // --> <!-- ºô¶¤@¼È°± 10 ¬í¡Aºô¶¤G¼È°± 20 ¬í¡Aºô¶¤T¼È°± 15 ¬í¡C // --> <SELECT NAME="slides"> <OPTION VALUE="10">´`Àôºô¶¤@ URL</OPTION> <OPTION VALUE="20">´`Àôºô¶¤G URL</OPTION> <OPTION VALUE="15">´`Àôºô¶¤T URL</OPTION> <!-- ... ¨ä¥L OPTION ³]©w ... // --> </SELECT> </FORM>µM«á§Ú̦b SlideShow() ¤¤§ï¼g¦p¤U¡G
/* ¼½©ñºô¶»¼¼WÅÜ¼Æ */ var nowno=0; function SlideShow() { // ... ¨ä¥L Script ±Ôz ... slideLoader.href=slideCollect[nowno].text; timer=setTimeout("SlideShow()",parseInt(slideCollect[nowno].value)*1000); nowno++; // ... ¨ä¥L Script ±Ôz ... }
/* ¼½©ñºô¶»¼¼WÅÜ¼Æ */ var nowno=0; function SlideShow() { /* ²M°£¼È°±¶¡¹j¾¹ª«¥óªºì³]©w */ clearTimeout(timer); if (nowno<slideCollect.length) { slideLoader.href=slideCollect[nowno].text; timer=setTimeout("SlideShow()",parseInt(slideCollect[nowno].value)*1000); nowno++; } // ... ¨ä¥L Script ±Ôz ... }¦p¦¹³]p¥Î·N¬O¦¸°õ¦æ SlideShow() ®É³£·|¥ý¨ú®ø¼È°±¶¡¹j¾¹ª«¥ó¡A¦Ó¥B¥u¦³¦b »¼¼WÅܼƤp©ó slideCollect Á`¼Æ®É¡A¤~·|n¨D¼È°±¶¡¹j¾¹©I¥s¦Û¤v¦A¦¸°õ¦æ¡C
/* ¼½©ñºô¶»¼¼WÅÜ¼Æ */ var nowno=0; function SlideShow() { /* ²M°£¼È°±¶¡¹j¾¹ª«¥óªºì³]©w */ clearTimeout(timer); if (nowno<slideCollect.length) { slideLoader.href=slideCollect[nowno].text; timer=setTimeout("SlideShow()",parseInt(slideCollect[nowno].value)*1000); nowno++; } else; { nowno=0;SlideShow();} }¹ï°Õ¡A´N¬O³o»ò²³æ¡A·í»¼¼WÅܼƶW¹L slideCollect Á`¼Æ®É¡A§â¼½©ñºô¶»¼¼WÅÜ¼Æ Âk¹s¡A«·s°õ¦æ¤@¦¸§Y¥i¡C¦Ü©óµL¼½©ñªº¥DnÅX°Ê¾¹¬O¼È°±¶¡¹j¾¹ª«¥ó timer ¦bÅX°Êªº¡A¦]¦¹«Å§i¨äµL®Ä§Y¥i¡A¦p§A¥i°µ¤@Ó¥i¨ÑÂsÄýªÌ©I¥s¤§²×¤î¼½©ñ¨ç¼Æ¦p¤U¡G
function StopLoop() { /* ²M°£¼È°±¶¡¹j¾¹ª«¥óªºì³]©w */ clearTimeout(timer); }µM«á¦b HTML ùذµÓ©I¥s¬É±¦p¡G
<A HREF="#" onclick="StopLoop();return false;">²×¤î¼½©ñ</A>§Y¥i¤¤Â_¶i¦æ¤¤ªº¼½©ñ¡C