Detecting if the browser window is moved with JavaScript?

前端 未结 6 2117
庸人自扰
庸人自扰 2020-12-10 12:48

This is for a demo... and i was just curious, can you detect if the window has been moved? Like if you move Firefox/Chrome/IE around your monitor? I doubt it, but I wanted t

6条回答
  •  余生分开走
    2020-12-10 13:24

    Unfortunately not. The DOM is only notified about window sizes, cursor positions, "focus" and "blur", etc; anything that affects drawing. Since moving a window doesn't necessarily require any of the contents to be "redrawn" (in a Javascript/Html engine sort of sense), the DOM, therefore, doesn't need to know about it.

提交回复
热议问题