title: Adding a param to a method in a plugin
body: <p>I am looking for a way to add a extra param to a method in my plugin.</p>
  
  <p>This example I use an update method, but it needs an extra param to tell what to update.</p>
  
  <p>// plugin wrapper</p>
  
  <pre><code>  ;(function($, window, document, undefined){
  
        var pluginName = 'myPlugin01';
  
        function Plugin(element, options){
  
            // vars here
        };
  
        Plugin.prototype = {
  
            init: function(){
  
            // init code here
  
            },
            update: function(param){
  
                // need the param value in this method
                if(param == 'bottom'){
                    alert('bottom it is...')
                }else{
                    alert('top it is...')
                }
  
            },
        };
  
        $.fn[pluginName] = function(option) {
            return this.each(function() {
                var $this   = $(this);
                var data    = $this.data(pluginName);
                var options = typeof option == 'object' &amp;&amp; option;
                if (!data){ 
                  $this.data(pluginName, (data = new Plugin(this, options)))
                }
                if (typeof option == 'string'){
                     data[option]();
                }
            });
        };
  
        $.fn[pluginName].defaults = {
            option1: true
        };
  
    })(jQuery, window, document);
  </code></pre>
  
  <p>// how I want to use it</p>
  
  <pre><code>$('.element').myPlugin('update','bottom');
  </code></pre>