Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Acquire Internet Explorer window position

How do I get in Internet Explorer values equivalent to: window.screenX and window.screenY in Firefox ? I've seen some "solution": window.screenLeft and window.screenTop but it is not correct. These properties give inner coordinates.

I move a window and I need values to use with window.moveTo() to restore the original location.

like image 262
Ilya Avatar asked Nov 05 '22 15:11

Ilya


1 Answers

var saveLeft = window.screenLeft;
var saveTop = window.screenTop;
window.moveTo(saveLeft, saveTop);
var savePos = [
    saveLeft + (saveLeft - window.screenLeft), 
    saveTop + (saveTop - window.screenTop)
];

Seems to work

like image 142
Ilya Avatar answered Nov 11 '22 06:11

Ilya