js屏幕闪烁
2013-08-20 22:31:38 -0400
背景闪烁效果
----Comments(1)----
jrj (@jrj) |
@ at 2013-08-20 22:35:
小心屏幕和眼睛哦/
源代码如下:
<html>
<head>
<title>背景闪烁效果</title>
</head>
<body>
<SCRIPT LANGUAGE='Javascript'>
<!-- Begin
var COLOR = 999999
var woot = 0
function stoploop() {
document.bgColor = '#000000';
clearTimeout(loopID);
}
function loopBackground() {
if (COLOR > 0) {
document.bgColor = '#' + COLOR
COLOR -= 111111
loopID = setTimeout('loopBackground()',1)
} else {
document.bgColor = '#000000'
woot += 10
COLOR = 999999
COLOR -= woot
loopID = setTimeout('loopBackground()',1)
}
}
// End -->
</SCRIPT>
<input type='button' value='显示效果' onClick='loopBackground()' name="button">
<input type='button' value='取消效果' onClick='stoploop()' name="button">
</body>
</html>
Back to home
Subscribe |
Register |
Login
| N