This is a demo of Menu Hotkeys. Hold down the Alt key and click a menu item.
Note: The menu item links are to the sections of this document.
Menu Hotkeys is a jQuery Plugin which allows users to quickly assign hotkeys (keyboard shortcuts) to HTML menu items. Navigation is one of the most important usability aspects of a web page. Being able to quickly navigate to pages within a website is a huge win for users. Menu Hotkeys is a great way to make your websites navigation more user friendly.
Enter your hotkey.
After clicking the Add Button, the Hotkey will be added and an Indicator will appear.
Δ Hope to remove this dependency in the near future
Download the production version or the development version.
In your web page:
<script src="dist/menu-hotkeys.min.js"></script> <script src="jquery.js"></script> <script src="bootstrap-popover.js"></script> <script src="dist/menu-hotkeys.min.js"></script> <script> $('#nav').menuHotkeys(); </script>
Any nested links under the #nav will get the ability to have hotkeys assigned. By default, shortcuts (hotkeys) are persisted to window.localStorage
.
Option Name | Description | Default Value |
---|---|---|
hotkeyPrefix | Starting keyboard sequence for all hotkeys. | ctrl + shift |
menuHotkeyUrl | URL to GET persisted shortcuts from and PUT to save | None |
Note: menuHotkeyUrl will PUT to menuHotkeyUrl/{menuItemName}
Example:
<script> $('#nav').menuHotkeys({ hotkeyPrefix: 'alt', menuHotkeyUrl: 'https://localhost/menu-hotkeys' }); </script>
This is the list of events that are fired when certain actions happen:
Event Name | Action | Arguments |
---|---|---|
menu-hotkeys-loaded | When the persisted hotkeys are loaded | Array of Objects with name and hotkey properties |
menu-hotkey-input-open | When Hotkey Input Prompt opens. | None |
menu-hotkey-input-close | When Hotkey Input Prompt closes. | None |
menu-hotkey-input-error | When Hotkey Input Prompt has an input error. | error menu-hotkey-updated |