한글자씩 배경색이 바뀌면서 강조되는 텍스트
<script type=”text/javascript”>
< !– 태그인넷 www.tagin.net
var bgcolour=”#ffffff”; // background colour
var hlcolour=”#bfceff”; // highlight colour
var speed=250; // speed colours change, 1 second = 1000
// 아래는 손대지 마세요*
var w3c=document.getElementById;
var ie45=document.all;
var p_txt, p_cnt=0;
window.omload=function() {
if (w3c||ie45) {
var phone=(w3c)?document.getElementById(“phonein”):document.all[“phonein”];
p_txt=(w3c)?phone.firstChild.nodeValue:phone.innerHTML;
if (ie45) {
var phoni=””;
for (var i=0; i<p_txt.length; i++) phoni+='<sp’+’an id=”phon’+i+'”>’+p_txt.charAt(i)+'</’+’span>’;
phone.innerHTML=phoni;
} else {
while (phone.childNodes.length) phone.removeChild(phone.childNodes[0]);
for (var i=0; i<p_txt.length; i++) {
var phoni=document.createElement(“span”);
phoni.setAttribute(“id”, “phon”+i);
phoni.appendChild(document.createTextNode(p_txt.charAt(i)));
phone.appendChild(phoni);
}
}
p_cnt=p_txt.length-1;
phone=setInterval (“phon1()”, speed);
}
}
function phon1() {
var p_ct=p_cnt%p_txt.length;
var p_tmp=(w3c)?document.getElementById(“phon”+p_ct):document.all[“phon”+p_ct];
p_tmp.style.backgroundColor=bgcolour;
p_tmp.style.fontWeight=”normal”;
p_ct=++p_cnt%p_txt.length;
p_tmp=(w3c)?document.getElementById(“phon”+p_ct):document.all[“phon”+p_ct];
p_tmp.style.fontWeight=”bold”;
if (((w3c)?p_tmp.firstChild.nodeValue:p_tmp.innerHTML)!=” “) p_tmp.style.backgroundColor=hlcolour;
}
// End –>
< /script>
< /head>
<body>
<span id=”phonein”>태그인넷 – 홈페이지 제작 강좌, 동영상 편집 강좌</span></p>