All Projects → turbo → justContext.js

turbo / justContext.js

Licence: MIT license
Styleable context menu in pure JS (no jQuery).

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to justContext.js

Ngx Contextmenu
An Angular component to show a context menu on an arbitrary component
Stars: ✭ 208 (+166.67%)
Mutual labels:  contextmenu
ng2-right-click-menu
Right click context menu for Angular 2+
Stars: ✭ 51 (-34.62%)
Mutual labels:  contextmenu
Modern-UI-Components-for-VBA
A helper dll for VBA users to design modern UI components. No install required!
Stars: ✭ 139 (+78.21%)
Mutual labels:  contextmenu
Vue Menu
Menu/Contextmenu Component for vue2
Stars: ✭ 227 (+191.03%)
Mutual labels:  contextmenu
ShellCommand
Customize your context menu. 告别注册表,自定义右键菜单。
Stars: ✭ 64 (-17.95%)
Mutual labels:  contextmenu
vue3-context-menu
A very simple context menu component for Vue3 一个简洁美观简单的Vue3右键菜单组件
Stars: ✭ 74 (-5.13%)
Mutual labels:  contextmenu
V Selectmenu
SelectMenu for Vuejs, A simple, easier and highly customized menu solution
Stars: ✭ 169 (+116.67%)
Mutual labels:  contextmenu
twtree
a highly customizable tree component for vue 2
Stars: ✭ 27 (-65.38%)
Mutual labels:  contextmenu
editable-treemenu
a treemenu component which can edit(add/delete/rename) by contextMenu based on vue.js 2.0
Stars: ✭ 24 (-69.23%)
Mutual labels:  contextmenu
VirusTotalScanner
Scan suspicious applications with over 60 different anti-viruses with a mere two clicks and five seconds!
Stars: ✭ 18 (-76.92%)
Mutual labels:  contextmenu
React Menu
React component for building accessible menu, dropdown, submenu, context menu and more.
Stars: ✭ 237 (+203.85%)
Mutual labels:  contextmenu
JonContextMenu
A beautiful and minimalist arc menu like the Pinterest one, written in Swift
Stars: ✭ 60 (-23.08%)
Mutual labels:  contextmenu
ContextMenuSwift
A better version of iOS 13 Context Menu
Stars: ✭ 162 (+107.69%)
Mutual labels:  contextmenu
Jspanel4
A JavaScript library to create highly configurable floating panels, modals, tooltips, hints/notifiers/alerts or contextmenus for use in backend solutions and other web applications.
Stars: ✭ 217 (+178.21%)
Mutual labels:  contextmenu
angular2-contextmenu
-Deprecated in favor of ngx-contextmenu- A context menu built with Angular 2 inspired by ui.bootstrap.contextMenu.
Stars: ✭ 68 (-12.82%)
Mutual labels:  contextmenu
Jquery Contextmenu
jQuery contextMenu plugin & polyfill
Stars: ✭ 2,148 (+2653.85%)
Mutual labels:  contextmenu
ctxmenu
Tiny and customizable context menu generator
Stars: ✭ 20 (-74.36%)
Mutual labels:  contextmenu
Open in Windows Terminal
No description or website provided.
Stars: ✭ 24 (-69.23%)
Mutual labels:  contextmenu
bookmarklets-context-menu
WebExtension allow to execute bookmarklets as privileged scripts
Stars: ✭ 67 (-14.1%)
Mutual labels:  contextmenu
howdyjs
一个包含Javascript插件、Vue3组件、Vue3指令的工具库
Stars: ✭ 77 (-1.28%)
Mutual labels:  contextmenu

justContext.js

justContext is a simple context menu plugin that doesn't require jQuery, but kicks ass anyway. Here are some of the features:

  • Just about 30 lines of JS and a bit CSS
  • Context menus can be styled. Two themes are included, plus three themes for drop shadow effects (off, light and dark)
  • Create unlimited context menus, every HTML element can host it's own, unique menu
  • Single elements can be disabled and are styled accordingly
  • Menus are auto-positioned relative to the mouse position and window dimensions
  • Menu do have fade-in and fade-out effect (again, no jQuery)
  • Support for fontawesome icons is built-in

justContext.js is featured at Unheap and cssscript.com.

Getting Started

Including

  1. View the demo here. All browsers but IE are supported.
  2. Include justContext in your website.

Styling

  1. Include the CSS for justContext. Either write your own, or just download a pre-configured one from here.
  2. Modify the HTML element you want to host a context menu on and give it a unique ID. For example:
<p class="jctx-host jctx-id-foo">Right-click this</p>

jctx-host marks a hosting element. foo is the unique ID for this menu.

Creating

  1. Now create the actual menu. We use the black theme here, and a drop shadow:
<ul class="jctx jctx-id-foo jctx-black jctx-black-shadow">
	<li data-action="cut">Cut</li>
	<li data-action="copy">Copy</li>
	<li data-action="paste">Paste</li>
	<hr>
	<li data-action="new_pkg">New package</li>
  <li data-action="new_cls">New class</li>
	<li data-action="new_intf" class="disabled">New interface (a disabled entry)</li>
</ul>

The jctx styles and hides the menu. The unique ID is re-used here to identify the parent. The data-action attribute of each menu entry is the string that is passed to the action handler when an entry is pressed.

Action Handling

  1. Define your action handler. A simple example that just displays the passed action is:
<!-- Defining a sample action handler (for all menus) -->
<script>
	function handleMenuAction(evt) {
		alert("Action required: " + evt);
	}
</script>
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].