Question:Which of the following represents the best way to make a custom right-click menu using jQuery? 

A $(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 

+ Answer
+ Report
Total Preview: 711

Copyright © 2024. Powered by Intellect Software Ltd