본문 바로가기
웹퍼블리싱/jquery

[JS] 버튼 백그라운드 색깔로 깜빡이게 하기

by developsigner 2018. 9. 21.

<script language="javascript" type="text/javascript"> 

<!-- 

/* 

Flashing text color Script- ? Dynamic Drive (www.dynamicdrive.com) 

Visit http://www.dynamicdrive.com for this script 

Credit must stay intact for use 

*/ 

//configure interval btw flash (1000=1 second) 

var speed=500 

function flashit(){ 

var crosstable=document.getElementById? document.getElementById("check_btn") : document.all? document.all.myexample : "" 

if (crosstable){ 

if (crosstable.style.backgroundColor.indexOf("rgb(12, 31, 51)")!=-1) 

crosstable.style.backgroundColor="#077af4" 

else 

crosstable.style.backgroundColor="rgb(12, 31, 51)" 

setInterval("flashit()", speed) 

//--> 

</script>



<button id="check_btn">깜빡임</button>


반응형

댓글