title: Pass parameters to javascript functions which is bind to events
body: <p>I have a function like this : </p>
  
  <pre><code> var that = this;
   this.context.on('focus', function(i) {
       var htmlElement = ele;
       var style = {left: 'auto', color: '#000000'};
  
       if(i !== null) {
           i = that.context.size()/2;
           style.left = i + 'px';
           //find htmlElement in DOM and apply style to it
       }
  });
  </code></pre>
  
  <p>The htmlElement and style will var for me in different calls. I need to pass an option such as</p>
  
  <p><code>var options = {style: someVaue, htmlELement: somelement}</code></p>
  
  <p>to the function so that it could be called multiple times with different options. If I pass the <code>options</code> like this :</p>
  
  <pre><code>var that = this;
  this.context.on('focus', function(i, options) {
      //use options.style and options.htmlElement 
  });
  </code></pre>
  
  <p>It doesn't work that way. Clearly I am doing something wrong since the <code>function</code> bind to <code>focus</code> event of <code>this.context</code> has <code>i</code> as an param but can't accept any other param. Any kind of help/suggestion is appreciated. </p>