网络编程
位置:首页>> 网络编程>> JavaScript>> JS按钮闪烁功能的实现代码

JS按钮闪烁功能的实现代码

作者:停留就好  发布时间:2024-08-03 03:08:23 

标签:js,按钮闪烁

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按钮闪烁功能的实现代码网站的支持!

来源:http://www.cnblogs.com/mychz/archive/2017/07/21/7218544.html

0
投稿

猜你喜欢

手机版 网络编程 asp之家 www.aspxhome.com