I have a straight forward draggable modal window via jquery kendu-ui.
My goal is to simply get the screen coordinates of the top
left
position of a modal, relative to the browser window... I am trying offset
and getBoundingClientRect()
methods, below is just an example of a few attempts, all attempts are constantly console logging 0
, 0
, .. what am I doing wrong here?
let ktop = $(".k-window").offset().top;
let ktlft = $(".k-window").offset().left;
console.log(ktop + " " + ktlft);
let ktl = document.querySelector('.k-window');
let procoords = ktl.getBoundingClientRect();
let ktl = document.querySelector('.k-window');
let ktlTop = ktl.offsetTop;
let ktlLeft = ktl.offsetLeft;