<button class="button" type="button" data-toggle="example-dropdown-1">Hoverable Dropdown</button>
-<div class="dropdown-pane" id="example-dropdown-1" data-dropdown data-hover="true">
+<div class="dropdown-pane" id="example-dropdown-1" data-dropdown data-hover="true" data-hover-pane="true">
Just some junk that needs to be said. Or not. Your choice.
</div>
```
Dropdown.defaults = {
/**
- * Amount of time to delay opening a submenu on hover event.
+ * Amount of time, in milliseconds to delay opening a submenu on hover event.
* @option
* @example 250
*/
*/
hover: false,
/**
- * Don't close dropdown when hovering over dropdown pane
+ * Prevent the dropdown pane from closing while hovering over it
* @option
- * @example true
+ * @example false
*/
hoverPane: false,
/**
- * Number of pixels between the dropdown pane and the triggering element on open.
+ * Number of pixels between the dropdown pane and the triggering element on open, on the Y-axis
* @option
* @example 1
*/
vOffset: 1,
/**
- * Number of pixels between the dropdown pane and the triggering element on open.
+ * Number of pixels between the dropdown pane and the triggering element on open, on the X-axis.
* @option
* @example 1
*/
*/
positionClass: '',
/**
- * Allow the plugin to trap focus to the dropdown pane if opened with keyboard commands.
+ * Allow the plugin to trap focus to the dropdown pane if opened with keyboard commands. Useful if your dropdown pane contains form elements.
* @option
* @example false
*/
trapFocus: false,
/**
- * Allow the plugin to set focus to the first focusable element within the pane, regardless of method of opening.
+ * Allow the plugin to set focus to the first focusable element within the pane, regardless of method of opening. Will cause the page to scroll your dropdown pane into view if opening via JS.
* @option
* @example true
*/
'data-yeti-box': $id,
'aria-haspopup': true,
'aria-expanded': false
- // 'data-resize': $id
+
});
this.options.positionClass = this.getPositionClass();
* @event Dropdown#show
*/
this.$element.trigger('show.zf.dropdown', [this.$element]);
- //why does this not work correctly for this plugin?
- // Foundation.reflow(this.$element, 'dropdown');
- // Foundation._reflow(this.$element.attr('data-dropdown'));
};
/**
this.usedPositions.length = 0;
}
this.$element.trigger('hide.zf.dropdown', [this.$element]);
- // Foundation.reflow(this.$element, 'dropdown');
};
/**
* Toggles the dropdown pane's visibility.