Raja Kode - CtxMenu adalah plugin menu context yang dinamis dan dapat disesuaikan untuk menggantikan menu pada saat klik kanan browser.

Cara memasang CtxMenu
1.Tambahkan JavaScript plugin CtxMenu ke halaman web kamu.
<script src="/path/to/CtxMenu/CtxMenu.js"></script>
2.Buat Context Menu baru untuk setiap halaman.
var contextMenu = CtxMenu();
3. Tambahkan Item berssamaan dengan Fungsi onClick, Ikon Kostum, dan list item yang ingin kamu tambahkan di context menu.
contextMenu.addItem("Item 1", function(){ // fired on click }); contextMenu.addItem("Item 2", function(){ // fired on click },Icon = "icon.png", 3);
4. Tambahkan pemisah ke menu context.
contextMenu.addSeparator();
5. Kamu juga bisa memasukan context menu ke elemen container apapun.
var contextMenu = CtxMenu("#myContainer");
6. Dapatkan item menu.
myItems = myContextMenu.getItems(); myItem = myContextMenu.getItemAtIndex(1);
Changelog:
07/16/2022
- Rewrite Positioning Code
04/05/2021
- Added getItems() & getItemAtIndex(), removed removeItem() methods.
12/30/2020
- Added dark mode colors that’ll be used if the browser’s theme settings are set to dark.
v1.0.0 (07/23/2020)
- Fixed typo in AddSeparator()
07/23/2020
- Fixed typo addSeperator -> addSeparator
10/22/2019
- Fixed a position issue for pages with scrollbars
08/13/2019
- Removed CtxMenuItem class & changed some variables to constants
08/10/2019
- Fixed an issue that could break the menu if the page had scrollbars
08/04/2019
- Added index option to addSeperator()
08/02/2019
- added min & max width to the image icon
08/01/2019
- The box-shadow now uses rgba instead of hex
- Fixed elements not being detected if it had multiple class names