Custom context menu.

RightMenu.js Introduction

Help you create a custom context menu in a specific area.

Demo

https://gongpeione.github.io/rightMenu

Usage

Add css and js.

<!doctype html> <html lang="zh_CN"> <head> <meta charset="UTF-8"> <title>Right Mouse Click Menu</title> <link rel="stylesheet" href="style.css"> </head> <body> <script src="RightMenu.js"></script> <script> new RightMenu(config); </script> </body> </html>

Configure

{ class: '.rightMenu', items: [ { type: 'link', title: 'Google', content: 'https://www.google.com', target: '_blank' }, { type: 'separator', }, { type: 'function', title: 'Alert', content: () => alert(1) }, { type: 'link', title: 'Disabled', disabled: true }, { type: 'text', title: 'Plain Text', class: 'plain' } ] }

Enjoy.

Changelog 2017/04/10 Rewrite 2015/03/14 Create rightMenu.js License

MIT licensed

Copyright (C) 2015 Shu, https://geeku.net

版权声明:

1、该文章(资料)来源于互联网公开信息,我方只是对该内容做点评,所分享的下载地址为原作者公开地址。
2、网站不提供资料下载,如需下载请到原作者页面进行下载。