Get locations across browsers
vartypeofwindow‘number‘windowwindow.screenX;vartypeofwindow‘number‘windowwindow.screenY;
The Firefox browser does not support Screenleft and screnntop, but supports Screenleft and screnntop for Screenx and Screeny;ie browsers, but Screenx and Screeny are not supported
Get size across browsers
varwidth =window. innerwidth;//window. must have, because IE does not supportvarHeight =window. innerheight;//If inner is supported, then use it,//What is not supported is to useDocumentMethods of the Objectif(typeofWidth! =' number ') {if(Document. Compatmode = =' Css1compat ') {width =Document. documentelement.clientwidth;//Standard IE height =Document. documentelement.clientheight; }Else{//Non-standard IE width =Document. body.clientwidth; Height =Document. body.clientheight; }}
Copyright NOTICE: This article for Bo Master original article, without Bo Master permission not reproduced.
Get the window's position and size across browsers with JavaScript