Код: Выделить всё
const rMenu = document.getElementById('rClickMenu');
var timeout;
var lastTap = 0;
document.addEventListener("contextmenu", (e) => {
e.preventDefault();
let mouseX = e.clientX || e.touches[0].clientX;
let mouseY = e.clientY || e.touches[0].clientY;
let menuHeight = rMenu.getBoundingClientRect().height;
let menuWidth = rMenu.getBoundingClientRect().width;
let width = window.innerWidth;
let height = window.innerHeight;
if (width - mouseX
Подробнее здесь: [url]https://stackoverflow.com/questions/79108152/how-to-make-a-hardcoded-right-click-menu-to-appear-on-the-screen[/url]