Here's my fiddle - http://jsfiddle.net/Jv9gc/
My problem at the moment is I haven't been able to get my custom right click menu to do anything, not even a simple alertbox. Can anyone help? What am I doing wrong?
Here's my fiddle - http://jsfiddle.net/Jv9gc/
My problem at the moment is I haven't been able to get my custom right click menu to do anything, not even a simple alertbox. Can anyone help? What am I doing wrong?
Try this please: Working Demo http://jsfiddle.net/77L4w/
Hope this will fit the cause :)
code
$('#movecam').draggable({
drag: function() {
$('#mecam').css('top', $(this).position().top);
$('#mecam').css('left', $(this).position().left);
},
stop: function() {
$('#mecam').css('top', $(this).position().top);
$('#mecam').css('left', $(this).position().left);
}
});
$("#movecam").bind("contextmenu", function(event) {
event.preventDefault();
$("div.custom-menu").hide();
$("<div class='custom-menu'><input id='propertz' type='button' name='propertz' value='Properties'></div>").appendTo("body").css({
top: event.pageY + "px",
left: event.pageX + "px"
});
init_prperty_click()
}).bind("click", function(event) {
$("div.custom-menu").hide();
});
$('input[name="closeme"]').click(function() {
$("#movecam").hide();
});
function init_prperty_click() {
$("input[name=propertz]").on('click', function() {
alert("haha");
});
}