閃爍背景
將下列程式碼複製至<head>程式碼</head>區內。
<CENTER> <FORM><INPUT TYPE="BUTTON" VALUE="Blink" onClick="blinkit(self)"> </FORM> </CENTER> |
將下列程式碼複製至<body>程式碼</body>之間。
<SCRIPT LANGUAGE="JavaScript"> function blinkOn(){ theWin.document.bgColor = "0000ff" nTimes++ JSCTimeOutID = window.setTimeout("blinkOff()",50); } function blinkOff(){ theWin.document.bgColor = "FFFFFF" if (nTimes < 3) JSCTimeOutID = window.setTimeout("blinkOn()",50); else theWin.history.go(0) } function blinkit(aWin) { nTimes = 0 theWin = aWin JSCTimeOutID = window.setTimeout("blinkOn()",50); } </SCRIPT> |