/ Published in: jQuery

Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
(function($){ var environment = {}; var methods = { init:function(options) { var options = $.extend({}, options); return this.each(function() { }); } }; $.fn.nameOfTemplate = function(method){ if ( methods[method] ) { return methods[method].apply( this, Array.prototype.slice.call( arguments, 1 )); } else if ( typeof method === 'object' || ! method ) { return methods.init.apply( this, arguments ); } else { $.error( 'Method ' + method + ' does not exist on jQuery.nameOfTemplate' ); } }; })(jQuery);
Comments
