Posted By

nikefido on 08/23/10


Tagged

javascript plugin template jquery extend


Versions (?)

Who likes this?

3 people have marked this snippet as a favorite

isholgueras
Some0ne
verostudios


jquery plugin template


 / Published in: jQuery
 

A template of a basic jQuery plugin, including over-ridable options

  1. (function($){
  2. $.fn.functionName = function(options) {
  3.  
  4. var options = $.extend({}, options);
  5.  
  6. return $(this).each(function(i) {
  7. //Optionally use the .each() function
  8. });
  9.  
  10. }//end $.fn
  11. })(jQuery);

Report this snippet  

Comments

RSS Icon Subscribe to comments
Posted By: nikefido on April 4, 2011

More betterer infoz here: http://docs.jquery.com/Plugins/Authoring (Read the proper namespacing section especially)

You need to login to post a comment.