时间:2021-07-01 10:21:17 帮助过:8人阅读
代码如下:
<script language= "javascript " type= "text/javascript "> function showit() { self.setInterval( "changeit() ", 800); } function changeit() { var bg = '# '; var color = new Array( "A ", "B ", "C ", "D ", "E ", "F "); var node = document.getElementById( "con ");//#33FF33 for (var j=1; j <7; j++) { var i = Math.round(Math.random()*10); if (i> =5) { bg = bg+color[i-5]; } else { bg = bg + i; } } node.style.color = bg; } </script> </HEAD> <BODY onload= "showit(); "> <div id= "con " style= "background:#330000;color:#FF3300;width:80px;height:30px;font-size:16pt; "> lasdflasdfhalsdfaldfladhladhlasd </div> </BODY> </HTML>
以上就是利用html实现文字闪烁的效果代码的详细内容,更多请关注Gxl网其它相关文章!