Is there an option to find center position (top and left) of an actual screen position?
My main goal is to show div in the center of the screen no matter where i scroll or click
You can use window
attributes to get center coordinates in pure javascript:
var x = window.innerWidth / 2;
var y = window.innerHeight / 2;
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With