Detecting if the browser window is moved with JavaScript? -
this demo... , curious, can detect if window has been moved? if move firefox/chrome/ie around monitor? doubt it, wanted see since can check resize , focus/blurred windows.
i can think of (heavy) work-around, check if window.screenx
, window.screeny
have changed every x milliseconds
var oldx = window.screenx, oldy = window.screeny; var interval = setinterval(function(){ if(oldx != window.screenx || oldy != window.screeny){ console.log('moved!'); } else { console.log('not moved!'); } oldx = window.screenx; oldy = window.screeny; }, 500);
though not recommend -- might slow , i'm not sure if screenx , screeny supported browsers
Comments
Post a Comment