MrSaints / Morphext

A simple, high-performance and cross-browser jQuery rotating / carousel plugin for text phrases powered by Animate.css.

Home Page:https://morphext.fyianlai.com/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

more compress and seccure this plugin

Freezon opened this issue · comments

(function($,c,l,d){"use strict";d={animation:"fadeInDown",separator:",",speed:2e3,complete:$.noop};function a(b,f){var e=$(b).addClass(c),se=$.extend({},d,f),t=this,ph=[],ival,i;t.animate=function(){i=++i%ph.length;e.html('<span class="animated '+se.animation+'">'+ph[i]+"</span>");$.isFunction(se.complete)&&se.complete.call(t)};t.start=function(){ival=setInterval(t.animate,se.speed)};t.stop=function(){clearInterval(ival)};$.each(e.html().split(se.separator),function(k,v){ph.push($.trim(v))});i=-1;t.animate();t.start()}$.fn[c]=function(d){return this.each(function(){$.data(this,l+c)||$.data(this,l+c,new a(this,d))})}})(jQuery,"morphext","plugin_");

Can you elaborate @Freezon ?

I just rebuilt the minimal version with the layout and removed _init and _interval from the global scope and also removed the text variables for the wrapper. Removed numerous occurrences of this

Did you do it programmatically? If so, I wouldn't mind taking in a PR to automate the process. Otherwise, I'm not sure if it is worth saving a few extra bytes, manually.

Closing due to inactivity.