Created
April 26, 2012 22:27
-
-
Save lotsofcode/2503723 to your computer and use it in GitHub Desktop.
jQuery Boilerplate
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ;(function($, undefined) { | |
| $.REPLACE_PLUGIN_NAME = function(element, options) { | |
| var defaults = {} | |
| var plugin = this; | |
| plugin.settings = {} | |
| var $element = $(element), element = element; | |
| plugin.init = function() { | |
| plugin.settings = $.extend({}, defaults, options); | |
| private_method() | |
| plugin.public_method() | |
| } | |
| plugin.init(); | |
| var private_method = function() {} | |
| plugin.public_method = function() {} | |
| } | |
| $.fn.REPLACE_PLUGIN_NAME = function(options) { | |
| return this.each(function() { | |
| if (undefined == $(this).data('REPLACE_PLUGIN_NAME')) { | |
| var plugin = new $.REPLACE_PLUGIN_NAME(this, options); | |
| $(this).data('REPLACE_PLUGIN_NAME', plugin); | |
| } | |
| }); | |
| } | |
| })(jQuery); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment