Skip to content

Instantly share code, notes, and snippets.

@supersym
Created November 5, 2012 15:16
Show Gist options
  • Save supersym/4017697 to your computer and use it in GitHub Desktop.
Save supersym/4017697 to your computer and use it in GitHub Desktop.
Essential jQuery Plugin Patterns

Patterns

jQuery plugins have very few defined rules, which one of the reasons for the incredible diversity in how they’re implemented. At the most basic level, you can write a plugin simply by adding a new function property to jQuery’s $.fn object, as follows:

$.fn.myPluginName = function() {
  // your plugin logic
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment