Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我需要知道是否为我的 javascript 程序打开了上下文菜单。 只有当我看到上下文菜单打开时,我才必须执行一个函数。
你可以帮帮我吗? 问候。
document.addEventListener('contextmenu', function() { console.log('ya right'); });
ya right当用户右键单击时,上面的代码片段会记录下来。
ya right