javascript - jQuery Context Menu Not Working -
i'm trying make custom right-click (context) menu website, title says i'm failing completely. jsfiddle example of code: http://jsfiddle.net/rb49h/
$(document).ready(function () { // context menu :p $context = $("#contextmenu"); $(document).bind("contextmenu", function(e) { e.preventdefault(); $context.fadeout(300); settimeout(function () { $context.css({top: e.pagey + "px", left: e.pagex + "px"}); $context.fadein(300); }, 301); }); $(document).bind("click", function (e) { if (!$(e.target).is("#contextmenu")) { $context.fadeout(300); } }); });
bootstrap setting .dropdown-menu
display:none
default. if override that, works:
.dropdown-menu { display:block; }
(as side note, don't care 300 ms delay. makes feel unresponsive , laggy).
Comments
Post a Comment