注意需要引入jquery function shakeTopText(id){ $(id).css("color", randomColor()); } function loadTopText(id, time) { setInterval("shakeTopText('"+id+"')", time); } function randomColor() { var R = parseInt(255 * Math.random()); var G = parseInt(255 * Math.random()); var B = parseInt(255 * Math.random()); R = R.toString(16); G = G.toString(16); B = B.toString(16); if (R.length == 1)R = "0" + R; if (G.length == 1)G = "0" + G; if (B.length == 1)B = "0" + B; return("#" + R + G + B); } window.οnlοad=function(){ loadTopText("#wyj",500); }
文字闪烁
最新推荐文章于 2024-01-04 13:36:33 发布