htmlelement-contextmenu
Version:
make a contextmenu on a html element
50 lines (33 loc) • 2.81 kB
Markdown
# htmlelement-contextmenu
<div style="display:inline">
<a target="_blank" title="build" href="https://travis-ci.org/Sylvain59650/htmlelement-contextmenu"><img src="https://travis-ci.org/Sylvain59650/htmlelement-contextmenu.png?branch=master" /></a>
<a target="_blank" title="version" href="https://www.npmjs.com/package/htmlelement-contextmenu"><img src="https://img.shields.io/npm/v/htmlelement-contextmenu.svg" /></a>
<a target="_blank" title="package" href="https://github.com/Sylvain59650/htmlelement-contextmenu"><img src="https://img.shields.io/github/package-json/v/Sylvain59650/htmlelement-contextmenu.svg" /></a>
<a target="_blank" title="dependencies" href="https://david-dm.org/Sylvain59650/htmlelement-contextmenu"><img src="https://img.shields.io/david/Sylvain59650/htmlelement-contextmenu.svg" /></a>
<a target="_blank" title="dependencies graph" href="http://npm.anvaka.com/#/view/2d/htmlelement-contextmenu"><img src="https://img.shields.io/badge/dependencies-graph-blue.svg" /></a>
<img src="https://img.shields.io/bundlephobia/min/htmlelement-contextmenu.svg" />
<img src="https://img.shields.io/badge/eslint-ok-blue.svg" />
<a href="https://codeclimate.com/github/Sylvain59650/htmlelement-contextmenu/maintainability"><img src="https://api.codeclimate.com/v1/badges/4218bd7c089629a131a4/maintainability" /></a>
<a target="_blank" title="tests" href="https://sylvain59650.github.io/htmlelement-contextmenu/"><img src="https://img.shields.io/badge/tests-passing-brightgreen.svg" /></a>
<img src="https://img.shields.io/npm/l/htmlelement-contextmenu.svg" />
<img src="https://hits.dwyl.com/Sylvain59650/htmlelement-contextmenu.svg" />
</div>
<div class="Note" style="color:orange;font-style:italic">
The lastest version of this document is available on [Github > htmlelement-contextmenu](https://github.com/Sylvain59650/htmlelement-contextmenu/blob/master/README.md)
</div>
## Introduction
this class is used to create a context menu accessible by right-clicking on an html element. <br/>
- characteristics
- The menu can be controlled with the keyboard.
- The API allows to dynamically add / remove / activate / deactivate menu items
- Add an icon or/and keyboard shortcut to each menu item
- The menu design can be easily modified via the css
- Several contextual menus can coexist on the same web page.
- work on IE11, Firefox & Chrome
## Installation
npm install htmlelement-contextmenu --save
or
yarn add htmlelement-contextmenu --save
## prerequisites for browser
<script src="node_modules/htmlelement-contextmenu/distrib/htmlelement-contextmenu.min.js"></script>
<a href="https://sylvain59650.github.io/htmlelement-contextmenu/">API & Demo</a>