gpt4 book ai didi

jquery - 在屏幕上定位窗口

转载 作者:行者123 更新时间:2023-12-03 22:19:27 24 4
gpt4 key购买 nike

有没有办法将用 jQuery 打开的窗口定位到屏幕的右上角?

这是我现在的代码:

$(document).ready(function() {
$("#dirs a").click(function() {
// opens in new window
window.open(this.href, "customWindow", "width=960, height=1040");
return false;
});
});

我希望它在屏幕的右上角打开,类似于在 Vista 或更高版本中使用 Windows Aero snap“捕捉”时的显示方式。有办法实现这一点吗?

顺便说一句,这是一个只有我会使用的简单页面,而且我只会在 1920x1080 显示器上的 Chrome 中使用它,因此它不需要任何花哨的东西来适应不同的浏览器或屏幕尺寸.

最佳答案

如果他想要它在右上角,他不需要这个吗?

window.open(this.href, "customWindow", "width=960, height=1040, top=0, left=960");

关于jquery - 在屏幕上定位窗口,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10728207/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com