forked from jdan/dynamo.js
-
Notifications
You must be signed in to change notification settings - Fork 0
/
dynamo.min.js
1 lines (1 loc) · 891 Bytes
/
dynamo.min.js
1
(function(a){a.fn.dynamo=function(){return this.each(function(b,c){var d=parseInt(a(c).attr("data-delay"))||3e3,e=parseInt(a(c).attr("data-speed"))||350,f=a(c).attr("data-lines").split(",");a(c).html(a("<span></span>").text(a(c).text()));var g=a(c).find("span:eq(0)").width();for(var h in f){var i=a("<span></span>").text(f[h]);a(c).append(i),g=Math.max(g,a(i).width())}a(c).find("span").each(function(b,d){var e=a(d).remove(),f=a("<div></div>").text(a(e).text());a(f).width(g),a(c).append(f)});var j=a(c).find(">:first-child").height();a(c).width(g).height(j),a(c).css({display:"inline-block",position:"relative",overflow:"hidden","vertical-align":"bottom","text-align":"left"}),a(c).attr("data-center")&&a(c).css("text-align","center");var k=function(){a(c).find("div:first").slideUp(e,function(){a(c).append(a(this).remove().show())})};setInterval(k,d)})},a(".dynamo").dynamo()})(jQuery);