1.首先在span标签或者div标签上面添加class=”shanshuo”
2.编写js代码
<script>
$(function () {
setInterval(‘set_Word_shanshuo ()’, 3000);
})
Function set_word_shanshuo () {
Var color = [‘red’, ‘green’, ‘yellow’, ‘black’, ‘purple’];
$(‘.shanshou’).CSS(‘color’,color[parseInt( Math.random()*color.length)]);
}
</script>
或者:
<script language="javascript">
function changeColor(){
var color="#ff0000|#00ff00|#0000ff|#888800|#880088|#008888|yellow|green|blue|gray";
color=color.split("|");
$('.blink').css('color', color[parseInt(Math.random() * color.length)]);
}
$(function () {
setInterval("changeColor()",200);
})</script>
新闻热点
疑难解答