[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 480
  • Last Modified:

Context Menu

Ive been trying to get an example of a context menu working as simply as possible, but for some reason I cannot get it to work. Ive been playing with this on and off for a few months now, but really need to get it working, so requesting any experts help

My code stands at:-
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="de" lang="de">
<head>
    <meta charset="utf-8" />
    <meta http-equiv="content-type" content="text/html; charset=utf-8" />
    <title>jQuery contextMenu</title>

    <script src="jquery-1.8.0.min.js" type="text/javascript"></script>
    <script src="jquery-ui-1.8.23.custom.min.js" type="text/javascript"></script>
    <script src="jquery.contextMenu.js" type="text/javascript"></script>
</head>
<body>
<div id="div_666" class="context-menu-one box menu-1">
    <strong>right click me</strong>
</div>
    <script type="text/javascript">
        
        $(function(){
            $.contextMenu({
                selector: '.context-menu-one', 
                callback: function(key, options) {
                    var m = "Default Callback clicked: " + key;
                    alert(m);
                },
                items: {
                    "edit": {name: "Edit", icon: "edit" callback: function(){ alert('boo-' + $(this).attr('id');); } },
                    "cut": {name: "Cut", icon: "cut"},
                    "copy": {name: "Copy", icon: "copy"},
                    "paste": {name: "Paste", icon: "paste"},
                    "delete": {name: "Delete", icon: "delete"},
                    "sep1": "---------",
                    "quit": {name: "Quit", icon: "quit"}
                }
            });
        });
    </script>
    
</body>
</html>

Open in new window


Ive been using the examples at medialize.github but without any sucess.

If anyone has any advice, I would be extreamly gratful.

Thank you
0
tonelm54
Asked:
tonelm54
1 Solution
 
binaryevoCommented:
jqwidgets has one we have gotten to implement relatively easily:

http://www.jqwidgets.com/jquery-widgets-demo/demos/jqxmenu/index.htm#demos/jqxmenu/contextmenu.htm
0

Featured Post

[Webinar] Cloud and Mobile-First Strategy

Maybe you’ve fully adopted the cloud since the beginning. Or maybe you started with on-prem resources but are pursuing a “cloud and mobile first” strategy. Getting to that end state has its challenges. Discover how to build out a 100% cloud and mobile IT strategy in this webinar.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now