Skip to content

Instantly share code, notes, and snippets.

@SevereOverfl0w
Created July 23, 2014 22:07
Show Gist options
  • Save SevereOverfl0w/02637921fd8cc9c97ac7 to your computer and use it in GitHub Desktop.
Save SevereOverfl0w/02637921fd8cc9c97ac7 to your computer and use it in GitHub Desktop.
$.fn.typeText = (text) ->
for ch, i in text
do(ch) =>
@queue =>
setTimeout (=>
$(this).append(ch).dequeue()
), 100
@connor4312
Copy link

    $.fn.typeText = (text) ->
      for ch, i in text
          @queue ->
              addch = ch
              setTimeout =>
                $(self).append addch
                $(self).dequeue()
              , 100

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment