I have been trying to figure out how to use the contextMenu.js plugin from s-yadav.
I've downloaded the js and css files and saved them into the same folder as my php script.
The examples for the plugin are on this page: http://ignitersworld.com/lab/contextMenu.html#demo
However, I'm struggling to figure out how to activate them on the page. I assume I need to call the plugin and then the script needs to go between tags.
However, this does not produce anything. The code is below. Can anyone point me in the right direction?
Thank you
<head>
<link rel="stylesheet" type="text/css" href="contextMenu.css" />
<script src="contextMenu.js"></script>
</head>
<body>
<script>
//For example we are defining menu in object. You can also define it on Ul list. See on documentation.
var menu = [{
name: 'create',
img: 'images/create.png',
title: 'create button',
fun: function () {
alert('i am add button')
}
}, {
name: 'update',
img: 'images/update.png',
title: 'update button',
fun: function () {
alert('i am update button')
}
}, {
name: 'delete',
img: 'images/delete.png',
title: 'delete button',
fun: function () {
alert('i am delete button')
}
}];
//Calling context menu
$('.testButton').contextMenu(menu);
</script>
<div id="testButton1" class="testButton iw-mTrigger">Click me</div>
</body>