标签:com http blog style class div img code java javascript log
以下为在JSP文件中,利用JS实现闪烁字体的代码:
HTML代码:
1 <div id="blink">一段会闪烁的字</div>
JavaScript代码:
1 <script type="text/javascript"> 2 function changeColor() { 3 var color="#f00|#0f0|#00f|#880|#808|#088|yellow|green|blue|gray"; 4 color=color.split("|"); 5 document.getElementById("blink").style.color=color[parseInt(Math.random() * color.length)]; 6 } 7 setInterval("changeColor()",200); 8 </script>
标签:com http blog style class div img code java javascript log
原文地址:http://www.cnblogs.com/nhebek/p/3696869.html