Typing Effect in jQuery / 제이쿼리로 타이핑 효과 주기



	//한글자 한글자 타이핑 효과 주기
     (function () {
        var app;
        $(document).ready(function () {
        	return app.init();
        });
        
        app = {
                text: 'If you can imagine it, you can create it.  If you can dream it, you can become it.',
                index: 0,
                chars: 0,
                speed: 100,
                container: '.selector',
                init: function () {
                        this.chars = this.text.length;
                        return this.write();
                       },
                write: function () {
                         $(this.container).append(this.text[this.index]);
                         if (this.index < this.chars) {
                              this.index++;
                              return window.setTimeout(function () {
                              return app.write();
                             }, this.speed);
                          }
                       }
             };
     }.call(this));


댓글

이 블로그의 인기 게시물

Lottery in javascript / 자바스크립트로 경품추첨기 만들기

Quick Menu(flying menu) in jQuery / 제이쿼리로 퀵메뉴 바 만들기

Accordion Menu in jQuery / 제이쿼리로 아코디언 메뉴 만들기