Skip to content

Instantly share code, notes, and snippets.

@ethyde
Last active August 29, 2015 14:07
Show Gist options
  • Save ethyde/072d2aa5ec7695e3514f to your computer and use it in GitHub Desktop.
Save ethyde/072d2aa5ec7695e3514f to your computer and use it in GitHub Desktop.
;(function( window, document, $, undefined ) {
'use strict';
var DEMO = DEMO || {};
DEMO.defaultOptions = {
newFontSize : '20px',
onSetup : null,
onAfterAnimation: null
};
DEMO.init = function(element, options){
var base = this;
base.$element = $( element );
base.element = element;
base.options = $.extend({}, DEMO.defaultOptions, options );
DEMO.animation(base);
if ( $.isFunction( base.options.onSetup ) ) {
base.options.onSetup.call( base );
}
};
DEMO.animation = function( base ){
base.$element.animate({
fontSize :base.options.newFontSize
}, {
complete: base.options.onAfterAnimation
}
);
};
$.fn.patternPlugin = function( options ) {
// use each if more than one element in pages
// return this.each(function () {
// new DEMO.init( this, options );
// });
return new DEMO.init( this, options );
};
})( window, document, jQuery );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment