Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/google-chrome/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript window.open()设置为left在chrome中无效_Javascript_Google Chrome - Fatal编程技术网

Javascript window.open()设置为left在chrome中无效

Javascript window.open()设置为left在chrome中无效,javascript,google-chrome,Javascript,Google Chrome,我有以下声明: window.open(url, windowName, 'width=' + screen.width + ',height=' + screen.height * 0.88 + ',left=0,top=0'); 这将打开位于监视器左上角的窗口。我发现Chrome将顶部设置正确。至于左,不,它不是。它在左边=7。如果我设置left=7,它将在7打开。如果我再次设置为100,它将在7打开。(我打开包含上述窗口的测试页面。在“新建匿名窗口”中打开。)

我有以下声明:

window.open(url, 
    windowName, 
    'width=' + screen.width + ',height=' + screen.height * 0.88
    + ',left=0,top=0');
这将打开位于监视器左上角的窗口。我发现Chrome将顶部设置正确。至于左,不,它不是。它在左边=7。如果我设置left=7,它将在7打开。如果我再次设置为100,它将在7打开。(我打开包含上述
窗口的测试页面。在“新建匿名窗口”中打开
。)

由于width=screen.width=1920,弹出窗口应覆盖整个窗口。现在,当left=7时,弹出窗口将转到右侧的第二个监视器(大约9像素)。如何将其设置为左侧从0开始

设置: 10号窗口。 两个监视器。 打开左侧监视器中的弹出窗口。 Chrome:62.0.3202.94版(官方版本)(64位)

左图:

右图:


您在离开之前错过了逗号 应该是

window.open(url, 
windowName, 
'width=' + screen.width + ',height=' + screen.height * 0.88
+ ',left=0,top=0');

另外,您可能需要将高度四舍五入。

很抱歉让您失望,我忘了复制逗号。在原始代码中,在
left=0
之前有一个逗号。