0

How can I correctly position a context menu while using glide.js? I have two screens, and when I want the context menu to appear correctly next to the element I am clicking on in the second screen I have to offset by the window width. Is there a way to not have to do this?

Here's a code snippet - I click on 'item' and the context menu is 'el'.

const offset = $(item).offset();      
const glide_offset = $(window).width();

el.style.top = (offset.top + event.offsetY) + "px";
el.style.left = (offset.left + event.offsetX + glide_offset) + "px";
Vlad
  • 3,058
  • 4
  • 25
  • 53

0 Answers0