!function(Foundation, $) {
  'use strict';

  /**
   * Creates a new instance of Drilldown.
   * @class
   * @fires Drilldown#init
   * @param {Object} element - jQuery object to make into a drilldown menu.
   * @param {Object} options - Overrides to the default plugin settings.
   */
  function Drilldown(element, options) {
    this.$element = element;
    this.options = $.extend(this.defaults, options);

    this.$container = $();
    this.$currentMenu = this.$element;

    this._init();

    /**
     * Fires when the plugin has been successfuly initialized.
     * @event Drilldown#init
     */
    this.$element.trigger('init.zf.drilldown');
  }

  Drilldown.defaults = {}

  Drilldown.prototype._init = function() {
    this.$container = $('<div class="js-drilldown"></div>');
    this.$container.css('width', this.$element.css('width'));
    this.$element.wrap(this.$container);
    this._prepareMenu(this.$element, true);
  }

  Drilldown.prototype._prepareMenu = function($elem, root) {
    var _this = this;

    // Create a trigger to move up the menu
    if (!root) {
      var $backButton = $('<li><a class="js-drilldown-back">Back</a></li>');
      $backButton.click(function() {
        _this.backward();
      });
      $elem.prepend($backButton);
    }

    // Look for sub-menus inside the current one
    $elem.children('li').each(function() {
      var $submenu = $(this).children('[data-submenu]');

      // If it exists...
      if ($submenu.length) {
        $submenu.addClass('js-drilldown-sub');

        // Create a trigger to move down the menu
        $(this).children('a').click(function() {
          _this.forward($submenu);
          return false;
        });

        // We have to go deeper
        _this._prepareMenu($submenu, false);
      }
    });
  }

  Drilldown.prototype.forward = function($target) {
    $target.addClass('js-drilldown-active');
    this.$currentMenu = $target;
  }

  Drilldown.prototype.backward = function() {
    this.$currentMenu.removeClass('js-drilldown-active');
    this.$currentMenu = this.$currentMenu.parents('[data-drilldown], [data-submenu]');
  }

  Foundation.plugin('drilldown', Drilldown);
}(window.Foundation, jQuery)
@@ -137,22 +137,22 @@
 @param %7B
-Object
+jQuery
 %7D elemen
@@ -399,16 +399,54 @@
  options
+ %7C%7C %7B%7D);%0A    console.log(this.defaults
 );%0A%0A    
@@ -700,16 +700,26 @@
 illdown.
+prototype.
 defaults
@@ -722,18 +722,223 @@
 ults = %7B
-%7D
 %0A
+    backButton: '%3Cli%3E%3Ca class=%22js-drilldown-back%22%3EBack%3C/a%3E%3C/li%3E'%0A  %7D%0A%0A  /**%0A   * Initializes the Drilldown by creating a container to wrap the menu bar in, and initializing all submenus.%0A   * @private%0A   */
 %0A  Drill
@@ -1192,225 +1192,610 @@
 %0A%0A  
-Drilldown.prototype._prepareMenu = function($elem, root) %7B%0A    var _this = this;%0A%0A    // Create a trigger to move up the menu%0A    if (!root) %7B%0A      var $backButton = $('%3Cli%3E%3Ca class=%22js-drilldown-back%22%3EBack%3C/a%3E%3C/li%3E'
+/**%0A   * Scans a menu bar for any sub menu bars inside of it. This is a recursive function, so when a sub menu is found, this method will be called on that sub menu.%0A   * @private%0A   * @param %7BjQuery%7D $elem - Menu to scan for sub menus.%0A   * @param %7BBoolean%7D root - If true, the menu being scanned is at the root level.%0A   */%0A  Drilldown.prototype._prepareMenu = function($elem, root) %7B%0A    var _this = this;%0A%0A    // Create a trigger to move up the menu. This is not used on the root-level menu, because it doesn't need a back button.%0A    if (!root) %7B%0A      var $backButton = $(_this.options.backButton
 );%0A 
@@ -2420,32 +2420,174 @@
  %7D%0A    %7D);%0A  %7D%0A%0A
+  /**%0A   * Moves down the drilldown by activating the menu specified in %60$target%60.%0A   * @param %7BjQuery%7D $target - Sub menu to activate.%0A   */%0A
   Drilldown.prot
@@ -2701,24 +2701,98 @@
 arget;%0A  %7D%0A%0A
+  /**%0A   * Moves up the drilldown by deactivating the current menu.%0A   */%0A
   Drilldown.
@@ -3026,15 +3026,8 @@
 ;%0A%7D(
-window.
 Foun

Add documentation to drilldown JS and make back button HTML into a setting