Friday, April 26, 2024
HomejQueryEasy Dynamic Context Menu In jQuery

Easy Dynamic Context Menu In jQuery


The jQuery Easy Context Menu plugin allows you to create a flowery, interactive, customized context menu that may assist make your consumer expertise stand out from the group.

The context menu will get gadgets dynamically from a JS array and shows them in a floating window when right-clicking the goal aspect with out interfering with the remainder of the web page’s content material. 

See Additionally:

How you can use it:

1. Obtain and cargo the simple-context-menu.min.js script after jQuery library.

<script src="/path/to/cdn/jquery.min.js"></script>
<script src="/path/to/dist/js/simple-context-menu.min.js"></script>

2. Name the operate on the goal aspect by which the customized context menu ought to seem and outline your menu gadgets within the choices array.

<div class="instance">
  Proper Click on Me
</div>
$(".aspect").simpleContextMenu({
  choices: [
    {
      label: "Facebook",
      // use Font Awesome Iconic Font
      icon: '<i class="fa fa-facebook"></i>',
      action: () => console.log("Facebook"),
    },
    {
      label: "Twitter",
      // use PNG
      icon: '<img src="twitter.png">',
      action: () => console.log("Twitter"),
    },
    // ...
  ],
});

3. Apply extra CSS class(es) to the context menu.

$(".aspect").simpleContextMenu({
  class: 'myClass1 myClass2'
});

4. Callback features accessible.

$(".aspect").simpleContextMenu({
  onShow: operate () {
    console.log("Proven");
  },
  onHide: operate () {
    console.log("Hidden");
  },
});

About Creator:

Creator: Md.Harun-Ur-Rashid

Web site: https://laravelarticle.com/


This superior jQuery plugin is developed by haruncpi. For extra Superior Usages, please test the demo web page or go to the official web site.

RELATED ARTICLES

LEAVE A REPLY

Please enter your comment!
Please enter your name here

Most Popular

Recent Comments