Js gets the coordinates of the position of the window relative to the left and top of the screen

  • 2020-03-30 03:00:50
  • OfStack

Gets the position of the window relative to the left and top of the screen:
 
var x=window.screenLeft?window.screenLeft: window.screenX ; 
var y=window.screenTop?window.screenTop: window.screenY; 
alert(x+" "+y); 

Related articles: