Posted By

vestimir on 02/15/11


Tagged

js plugin template jquery skel


Versions (?)

Who likes this?

7 people have marked this snippet as a favorite

vestimir
maltem
sethetter
Some0ne
jaypplr
shalomfriss
rickygri


jQuery plugin skel


 / Published in: jQuery
 

  1. (function($) {
  2. $.fn.PLUGIN_NAME = function(options) {
  3. var opts = $.extend({}, $.fn.PLUGIN_NAME.defaults, options);
  4. return this.each(function() {
  5. $this = $(this);
  6.  
  7. $this.css({ 'color': opts.color });
  8. $this.html($.fn.PLUGIN_NAME.METHOD(opts.text));
  9. });
  10. };
  11.  
  12. $.fn.PLUGIN_NAME.METHOD = function(txt) {
  13. return txt;
  14. };
  15.  
  16. $.fn.PLUGIN_NAME.defaults = {
  17. color: 'red',
  18. text: 'Hello world! '
  19. };
  20. })(jQuery);

Report this snippet  

You need to login to post a comment.