Question: Which of the following represents the best way to make a custom right-click menu using jQuery?
A
B
C
D
$(document).bind("contextmenu", function(event) {
event.preventDefault();
$("<div class='custom-menu'>Custom menu</div>") .appendTo("body") .css({top: event.pageY + "px", left: event.pageX + "px"});
});
B
$(document).bind("contextrightmenu", function(event) {
event.preventDefault();
$("<div class='custom-menu'>Custom menu</div>") .appendTo("body") .css({top: event.pageY + "px", left: event.pageX + "px"});
});
C
$(document).bind("rightclick", function(event) {
event.preventDefault();
$("<div class='custom-menu'>Custom menu</div>") .appendTo("body") .css({top: event.pageY + "px", left: event.pageX + "px"});
});
D
None
Note: Not available