站 内 搜 索
热门特效推荐
您当前位置:
中国素材首页
>>
网页特效
>>
背景类
>> 闪烁的霓虹灯
闪烁的霓虹灯
中国素材网 www.sucai86.com 2005-8-8 14:17:13 流量数:
闪烁的霓虹灯
[
查看演示
] 源码如下
----------------------------------------------------------------------------------------
脚本说明:
第一步:把如下代码加入<body>区域中:
<SCRIPT LANGUAGE="JavaScript">
<!--
// create row of radio buttons
lay(20)
// set index of lamp to start animation
var current = 0
// set speed (pause in milliseconds between each movement)
var speed = 1000
function lay(num) {
// assign "greater than" character to variable
var gt = unescape("%3e")
// open form
document.write("<FORM NAME='animation'" + gt)
// use loop to lay radio buttons down (all buttons in same group)
for (var i = 0; i < num; ++i) {
document.write("<INPUT TYPE='radio' NAME='lamps'" + gt)
}
// close form
document.write("</FORM" + gt)
}
function animate() {
// click next radio button
document.animation.lamps[current].click()
// if radio button is the last one reset variable to 0 (otherwise increment)
current = (current == document.animation.lamps.length - 1) ? 0 : ++current
// recursive call after speed milliseconds
timerID = setTimeout("animate()", speed)
}
// -->
</SCRIPT>
第二步:把<body>中的内容改为
<body bgcolor="#fef4d9" onLoad="animate()">