웹마스터 팁
page_full_width" class="col-xs-12" |cond="$__Context->page_full_width">
두가지 색으로 깜박거리는 텍스트
2006.03.17 12:43
http://www.nzeo.com/bbs/zboard.php?id=p_javascript&no=66
위의 링크의 소스와 비슷하면서 다릅니다.
이 소스에선 두가지 색상이 교대로 깜박거립니다.
<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("myexample") : document.all? document.all.myexample : ""
if (crosstable){
if (crosstable.style.color.indexOf("green")!=-1)
crosstable.style.color="red"
else
crosstable.style.color="green"
}
}
setInterval("flashit()", speed)
//-->
</script>
head부분에 넣어줍니다.
<div id="myexample" style="color: green;"> 깜박거리는 텍스트로 변신완료</div>
body 부분에 넣어줍니다.
스크립트와 스타일에서 색상은 얼마든지 변화할수있습니다.
id랑 style만 지정해주면 어떠한 태그에서도 적용가능합니다.
※파이어폭스와 익스에서 표현됩니다.
출처 http://www.dynamicdrive.com/dynamicindex11/other2.htm
이쪽에선 border- 테두리를 깜박이게 하는건데 텍스트로 변신시켰습니다.
위의 링크의 소스와 비슷하면서 다릅니다.
이 소스에선 두가지 색상이 교대로 깜박거립니다.
<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("myexample") : document.all? document.all.myexample : ""
if (crosstable){
if (crosstable.style.color.indexOf("green")!=-1)
crosstable.style.color="red"
else
crosstable.style.color="green"
}
}
setInterval("flashit()", speed)
//-->
</script>
head부분에 넣어줍니다.
<div id="myexample" style="color: green;"> 깜박거리는 텍스트로 변신완료</div>
body 부분에 넣어줍니다.
스크립트와 스타일에서 색상은 얼마든지 변화할수있습니다.
id랑 style만 지정해주면 어떠한 태그에서도 적용가능합니다.
※파이어폭스와 익스에서 표현됩니다.
출처 http://www.dynamicdrive.com/dynamicindex11/other2.htm
이쪽에선 border- 테두리를 깜박이게 하는건데 텍스트로 변신시켰습니다.