인터넷정보

글자를 쓰면 텍스트박스 안에 멋지게 입력되게 하기

알 수 없는 사용자 2007. 10. 18. 14:07
<SCRIPT>
var numLeft=-5
var numTop=15

function load(){
if(event.keyCode!=13){
numLeft+=6.5
box.innerHTML+="<span id=text style='position:absolute;top:"+numTop+";left:"+numLeft+";'></span>"
obj=document.all["text"]
chr="&#"+event.keyCode
j=obj.length-1
typing(200,j,chr);
}
}

function typing(b,i,c){
filterNum=100-b/2
document.all["in"].focus();
obj=document.all["text"]
if(b>15){obj[i].innerHTML="<div style='filter:alpha(opacity="+filterNum+");width:25;font-weight:bold;font-size:"+b+"'><center>"+c+"</div>"

b=b-2
setTimeout('typing('+b+','+i+',"'+c+'")',10)
}
else{obj[i].style.visibility='hidden'
if(obj[i].innerText==""){obj[i].innerText=" "};
document.all["in"].value+=obj[i].innerText
}
}
</SCRIPT>
<style>
#text{color:#FFB200;font-weight:bold;}
body {font-size:9pt;}
</style>

<BODY id="box" onload='document.all["in"].focus();'>
<input type=text name=in onkeypress=load() size=50 style="border:solid 1 #000000;background-color:#FFFFFF;color:#000000;">
반응형