html
<body onload="blinklink()" onunload="stoptimer()"> <a href="javascript:;" rel="external nofollow" class="iforeginbtn" id="flashit">馬上注冊領取</a></div>
js
var flashit=document.getElementById('flashit');function blinklink(){if(flashit.style.backgroundColor=='rgb(232, 83, 63)'){ //注意:這里拿到的是rgb格式的 flashit.style.backgroundColor='#485fbd'; }else{ flashit.style.backgroundColor='rgb(232, 83, 63)'; } timer=setTimeout("blinklink()",300);}function stoptimer(){ clearTimeout(timer);}總結
以上所述是小編給大家介紹的JS按鈕閃爍功能的實現(xiàn)代碼,希望對大家有所幫助,如果大家有任何疑問請給我留言,小編會及時回復大家的。在此也非常感謝大家對錯新站長站網(wǎng)站的支持!
新聞熱點
疑難解答
圖片精選