title: Using a function in jquery contextMenu selector
body: <p>Below is an example from <a href="https://github.com/medialize/jQuery-contextMenu" rel="nofollow">https://github.com/medialize/jQuery-contextMenu</a>.</p>
  
  <p>What I need to do is to put a function in the "selector:" that will use a bunch of logic  to make the decision on an element candidacy.</p>
  
  <p>Any suggestions?</p>
  
  <pre><code>$(function(){
      $.contextMenu({
          selector: '.context-menu-one', 
          callback: function(key, options) {
              var m = "clicked: " + key;
              window.console &amp;&amp; console.log(m) || alert(m); 
          },
          items: {
              "edit": {name: "Edit", icon: "edit"},
              "cut": {name: "Cut", icon: "cut"},
              "copy": {name: "Copy", icon: "copy"},
              "paste": {name: "Paste", icon: "paste"},
              "delete": {name: "Delete", icon: "delete"},
              "sep1": "---------",
              "quit": {name: "Quit", icon: "quit"}
          }
      });
  
      $('.context-menu-one').on('click', function(e){
          console.log('clicked', this);
      })
  });
  </code></pre>