jQuery Mouse Right-Click Context Menu Plugin (Original)
Add-ons

Plugin Description: jQuery mouse right-click context menu.
Last Updated: 2021-03-23 00:13:02
Changelog:Improved styling and added themes.
Last Updated: 2021-03-16 00:17:30
Changelog:Improved the styling.
Last Updated: 2021-03-16 00:05:09
Usage
Include the JavaScript and CSS files.
1 2 3 4 | <link rel="stylesheet" type="text/css" href="css/context-menu.css"/><script src="js/context-menu.js"></script> |
Usage:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 | $("#menu4").mouseMenu({ // Level 1 Menu options: [{ title: 'Refresh', // Submenus are automatically disabled. disabled: true, icon: '<i class="fa fa-refresh"></i>', child: [{ title: 'Refresh Current', icon: '<i class="fa fa-android"></i>' }, { title: 'Refresh All', icon: '<i class="fa fa-apple"></i>' }, ] }, { title: 'Lock', icon: '<i class="fa fa-lock"></i>' }, { title: 'Close', icon: '<i class="fa fa-close"></i>', child: [{ title: 'Close Current', icon: '<i class="fa fa-camera"></i>' }, { title: 'Close Others', icon: '<i class="fa fa-calendar"></i>' }, { title: 'Close All', disabled: true, icon: '<i class="fa fa-database"></i>' } ], }, { title: 'Open in New Window', icon: '<i class="fa fa-plus"></i>' }, ], afterInit: function(ul) { // Display the menu after initialization ul.css({ 'top': 100, 'left': 710 }).show(); }}); |
If you need to dynamically change the disabled property or modify menu options, simply call the mouseMenu method again and set the disabled property as needed.
评论