/* * jquery.typewriter.js - TypeWriter Text Effect jQuery Plugin * Author: Jorge Moreno aka Moro (moro.es, @alterebro) * License: Released under the MIT license: http://www.opensource.org/licenses/mit-license.php */ (function(e,t,n,r){function o(t,n){this.element=t;this.options=e.extend({},s,n);this.string=e(t).html();this._defaults=s;this._name=i;this.init()}var i="typewriter";var s={rotatingLetters:20,speed:10,chars:"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ",placeholder:"",placeholder_class:"placeholder",callback:function(){}};o.prototype={init:function(){e(this.element).html("");var t=this.extended_string();var n=0;var r=t.length*this.options.rotatingLetters+1;var i=this.options.rotatingLetters+1;var s=this.string;var o=this.element;var u=this.finish;var a=this.options.callback;var f=this.options.placeholder;var l=this.options.placeholder_class;var c=setInterval(function(){if(n<=r){output="";for(var h=0;h0?false:Math.abs(h-n)'+f+"";if(s[h]==" "){t[h][val]=" "}output+=val?t[h][val]:replacement}e(o).html(output);n++;if(output==s){u(c,a)}}else{u(c,a)}},this.options.speed)},finish:function(e,t){clearInterval(e);t()},rand:function(e,t){return Math.floor(Math.random()*(t-e+1)+e)},get_random_chars:function(e){var t=new Array;for(var n=0;n