Menu

타이핑 효과3

2016. 6. 1. 19:18

안개핑 Javascript

 

 

<html>

<head>
</head>

<body bgcolor="white" text="black" link="blue" vlink="purple" alink="red" background="script/imge/20.jpg">
<p align="center">
<br>  <SCRIPT language=JavaScript1.2>

    var line=new Array()
                line[1]="어서오세요. 반갑네요.."
                line[2]="삶의향기 쉬어가세요 "
                line[3]="lia.pe.kr.이사했지요.^^"
                line[4]="어떻게 알고 오셨나요?.."
        var ts_fontsize="14px"
        var longestmessage=1
        for (i=2;i<line.length;i++){
                if (line[i].length>line[longestmessage].length)
                longestmessage=i
}
 
        var tscroller_width=line[longestmessage].length
                lines=line.length-1

        if (document.all||document.getElementById){
                document.write('<form name="bannerform">')
                document.write('<input type="text" name="banner" size="'+tscroller_width+'"')
                document.write('  style="background-color: '+document.bgColor+'; color:red '+document.body.text+'; font-family: 이솝체; font-size: '+ts_fontsize+'; font-weight:bold; border: medium none;" onfocus="blur()">')
                document.write('</form>')
}
 
                temp=""
                nextchar=-1;
                nextline=1;
                cursor="\\"
        function animate(){
        if (temp==line[nextline] & temp.length==line[nextline].length & nextline!=lines){
                nextline++;
                nextchar=-1;
                document.bannerform.banner.value=temp;
                temp="";
                setTimeout("nextstep()",1000)
        }
        else if (nextline==lines & temp==line[nextline] & temp.length==line[nextline].length){
                nextline=1;
                nextchar=-1;
                document.bannerform.banner.value=temp;
                temp="";
                setTimeout("nextstep()",1000)
        }
        else{
                nextstep()
        }
}

        function nextstep(){
                if (cursor=="\\"){
                        cursor="|"
                }
                else if (cursor=="|"){
                        cursor="/"
                }
                else if (cursor=="/"){
                        cursor="-"
                }
                else if (cursor=="-"){
                        cursor="\\"
                }
 
        nextchar++;
        temp+=line[nextline].charAt(nextchar);
        document.bannerform.banner.value=temp+cursor
        setTimeout("animate()",20)}

        if (document.all||document.getElementById)
                window.onload=animate

</SCRIPT>
</p>
<table width="450" border="0" align="center" cellspacing="0" bordercolordark="white" bordercolorlight="black">
  <tr>
    <td>
<p>&nbsp;</p>
      <P align="center">&nbsp;</P>
            <p align="center"><br>&nbsp;</p>
</td>
  </tr>
</table>
</body>

</html>

'Javascript' 카테고리의 다른 글

주기적으로 바꾸는 스크롤바  (0) 2016.06.01
춤추는 글자  (0) 2016.06.01
요일마다 바뀌는 배경색  (0) 2016.06.01
요일별로 배경그림바꾸기  (0) 2016.06.01
자동으로 열리는 새창  (0) 2016.06.01