jQuery: Typed Text [Plugin] v1.2.2
A jQuery plugin that animates text in an element to make it seem as if it is being typed.
HTML
<div id="MyTypedText">Sveiki mano vardas jis toks yra esu 41 metu isiskyres gyvenu vienas Šiauliu miete dirbantis nerūkantis negerentis vertinu ištikimybe atvyrumą tiesa geriau skaudi tiesa į akis nei melas ar apsimetimas jieškau atvyros kuriai ištikimybė svarbi yra nematerelistė nebijanti gyvenimo vingiu sunkumu ir kuri norėtu eiti kartu gyvenimo keliu telefonas</div>
JavaScript
/**
* User Interface Typed Text plugin for jQuery v1.6.4 or >.
*
* Version: 1.2.2
*
* Copyright (C) 2015 Norberto Hernandez
**/
// the semi-colon before function invocation is a safety net against concatenated
// scripts and/or other plugins which may not be closed properly.
;(function($) {
/**
* The plugin takes 0 to 3 arguments; If only one argument is supplied it must be
* a string; if no arguments are supplied the plugin will attempt to get the
* text from within the selector element. Or you could choose to customize the
* plugin's effect even further by also using either or both of
* the other possible parameters.
*
* @param [string] - The text to animate the plugin should animate.
* @param [int] - The amount of milliseconds between each letter being displayed. [OPTIONAL]
* @param [function] - The function you would like the plugin to execute upon
* successful completion of the text animation.
**/
$.fn.typedText = function() {
var $this = $(this);
/**
* Proccess each given argument by determining what each argument
* is referring to.
**/
var processArgs = function(args) {
//Store the number of arguments
var numOfArgs = args.length;
// Set the variable we're going to return at the end of the function.
// The variable will hold an object that will contain the given parameters
// if possible.
var givenArgs = {
text2Type: "",
space: 63,
callback: ""
};
//Make sure that the amount of arguments is only 1-3
if(numOfArgs >= 1 && numOfArgs <= 3) {
//Set the "currentArg" & "argType" vars before the loop so it won't get initiated multiple times.
var currentArg;
var argType;
/**
* Go through...