diff --git a/jquery.airport.js b/jquery.airport.js index 021e0e2..5a14526 100644 --- a/jquery.airport.js +++ b/jquery.airport.js @@ -47,7 +47,7 @@ } if (opts.colors) { - colors = opts.colors.split(','); + colors = opts.colors.replace(/\s+/g, '').split(','); } //a - number of the span element //b - for checking char[b] against each letter in array[xx] diff --git a/jquery.airport.min.js b/jquery.airport.min.js index 9b83cbf..cc6ab01 100644 --- a/jquery.airport.min.js +++ b/jquery.airport.min.js @@ -1,3 +1 @@ -(function(f){f.fn.airport=function(b,u){function g(e,c,d,a){var r=k.find(".c"+e),p=b[d]?b[d].substring(a,a+1):null,l,m,s=b[d]?f.trim(b[d]).length:null,t=b[d-1]?f.trim(b[d-1]).length:f.trim(b[0]).length;d>=b.length?h.loop?l=setTimeout(function(){g(0,0,0,0)},10):clearTimeout(l):a>=j?l=setTimeout(function(){h.colors&&(m=q[~~(Math.random()*q.length)],k.css("color","#"===m.substring(0,1)?m:"#"+m));g(0,0,d+1,0)},h.transition_speed):(r.html(" "===n[c]?" ":n[c]),l=setTimeout(function(){if(c>n.length)g(e+ -1,0,d,a+1);else if(n[c]!==p.toLowerCase())g(e,c+1,d,a);else{r.html(" "===p&&h.fill_space?" ":p);if(ss){for(e;ej&&(j=b[c].length);for(;a--;)b[a]+=Array(j-b[a].length+1).join(" ");for(c=j;c--;)a=document.createElement("span"),a.className="c"+c,k.prepend(a); -h.colors&&(q=h.colors.split(","));g(0,0,0,0)}})(jQuery); \ No newline at end of file +(function(a){a.fn.airport=function(g,n){var b=a.extend({transition_speed:1000,loop:true,fill_space:false,colors:null},n),m=a(this),j=["a","b","c","d","e","f","g"," ","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z","-","1","2","3","4","5","6","7","8","9","0"],h,c,d=0,i=g.length,f=g.length;function e(p,o){return p+new Array(o-p.length+1).join(" ")}m.empty();while(i--){if(g[i].length>d){d=g[i].length}}while(f--){g[f]=e(g[f],d)}h=d;while(h--){var k=document.createElement("span");k.className="c"+h;m.prepend(k)}if(b.colors){c=b.colors.replace(/\s+/g,"").split(",")}function l(x,w,v,u){var q=m.find(".c"+x),r=g[v]?g[v].substring(u,u+1):null,p,s,o=g[v]?a.trim(g[v]).length:null,t=g[v-1]?a.trim(g[v-1]).length:a.trim(g[0]).length;if(v>=g.length){if(!b.loop){clearTimeout(p);return}p=setTimeout(function(){l(0,0,0,0)},10)}else{if(u>=d){p=setTimeout(function(){if(b.colors){s=c[~~(Math.random()*c.length)];m.css("color",s.substring(0,1)==="#"?s:"#"+s)}l(0,0,v+1,0)},b.transition_speed)}else{q.html((j[w]===" ")?" ":j[w]);p=setTimeout(function(){if(w>j.length){l(x+1,0,v,u+1)}else{if(j[w]!==r.toLowerCase()){l(x,w+1,v,u)}else{q.html((r===" "&&b.fill_space)?" ":r);if(oo){for(x;x