IE11 是否支持 window.moveTo(x,y)?
Does IE11 support window.moveTo(x,y)?
问题不言自明。
上下文如下,我试图在我的三台显示器上使用 window.open() 打开三个 windows。它不接受负值,为此我需要一种替代方法来将每个 window 定位到屏幕上。我希望它能在 IE11 上运行。
https://developer.mozilla.org/en-US/docs/Web/API/Window/moveTo 帮助不大。
编辑:
window.moveTo 适用于使用 window.open() 方法打开的 windows,但它们只会在屏幕内移动打开的 window(在我的例子中是 0,0 到 1920*1024)
你可以尝试参考Mike Burr给出的这个解释,可能有助于理解背后的逻辑。
Depending on how your video driver handles multiple monitors (as 2
logical screens or 1 logical screen), this will cause the moveto(0,0)
method to place the window on whatever logical screen the window is
on. In my experience, most video drivers manipulate multiple monitors
as separate logical screens (typically leaving the Windows task bar
across the left monitor), thus leading to the behavior that you
described. I have seen some Nvidia cards and drivers that stretch the
taskbar across both monitors (and would possibly allow the
moveto(0,0) to move the window to the left monitor because both
screens are being manipulated as a single logical screen). Hope this
helps.
参考:
javascript moveTo(0,0): strange behavior in multiple monitor environment
问题不言自明。
上下文如下,我试图在我的三台显示器上使用 window.open() 打开三个 windows。它不接受负值,为此我需要一种替代方法来将每个 window 定位到屏幕上。我希望它能在 IE11 上运行。
https://developer.mozilla.org/en-US/docs/Web/API/Window/moveTo 帮助不大。
编辑: window.moveTo 适用于使用 window.open() 方法打开的 windows,但它们只会在屏幕内移动打开的 window(在我的例子中是 0,0 到 1920*1024)
你可以尝试参考Mike Burr给出的这个解释,可能有助于理解背后的逻辑。
Depending on how your video driver handles multiple monitors (as 2 logical screens or 1 logical screen), this will cause the moveto(0,0) method to place the window on whatever logical screen the window is on. In my experience, most video drivers manipulate multiple monitors as separate logical screens (typically leaving the Windows task bar across the left monitor), thus leading to the behavior that you described. I have seen some Nvidia cards and drivers that stretch the taskbar across both monitors (and would possibly allow the moveto(0,0) to move the window to the left monitor because both screens are being manipulated as a single logical screen). Hope this helps.
参考:
javascript moveTo(0,0): strange behavior in multiple monitor environment