To get the dead center x and y position of the viewers screen in Javascript we need to know ...
This gives us the exact center X and the exact center Y of the part of the web page the visitor is at right now.
The function to get the center X and center Y of the visitors current place on the web page is return from a function as an array.
If you want the exact center X and center Y to update as the visitor navigates around the webpage, call the Javascript window.onscroll
function.
Feel free to right click this page and view the source code. This function to find the exact center X and center Y of the website visitors browser viewport is what is keep the red + in the exact center of the screen.