时间:2021-03-18 09:44:59 | 栏目:JavaScript代码 | 点击:次
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);
}
总结