Return to Snippet

Revision: 44709
at April 16, 2011 04:48 by nikefido


Initial Code
(function($){

	var environment = {};
	
	var methods = {
		init:function(options) {
			
			var options = $.extend({}, options);
			
			return this.each(function() {
				
			});
			
		}
	};
	
	$.fn.pluginName = 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.pluginName' );
		}
	};
})(jQuery);

Initial URL


Initial Description
Following these docs: http://docs.jquery.com/Plugins/Authoring

Initial Title
better jquery plugin template

Initial Tags


Initial Language
jQuery