code: function() {
              this.$menu = $('<div class="' + this.settings.menuClass + '" style="display: none" />');
  
              var $ul = $('<ul/>').appendTo(this.$menu);
  
              for (var i in this.options) {
                  if (!this.options.hasOwnProperty(i)) {
                      continue;
                  }
  
                  var option = this.options[i];
  
                  if (option === '-') {
                      // Create a new <ul>
                      $('<hr/>').appendTo(this.$menu);
                      $ul = $('<ul/>').appendTo(this.$menu);
                  }
                  else {
                      var $li = $('<li></li>').appendTo($ul),
                          $a = $('<a>' + option.label + '</a>').appendTo($li);
  
                      if (typeof option.onClick === 'function') {
                          // maintain the current $a and options.onClick variables
                          (function($a, onClick) {
                              setTimeout($.proxy(function() {
                                  $a.mousedown($.proxy(function(ev) {
                                      this.hideMenu();
                                      // call the onClick callback, with the scope set to the item,
                                      // and pass it the event with currentTarget set to the item as well
                                      onClick.call(this.currentTarget, $.extend(ev, {currentTarget: this.currentTarget}));
                                  }, this));
                              }, this), 1);
                          }).call(this, $a, option.onClick);
                      }
                  }
              }
          }
docs: Build Menu