gpt4 book ai didi

javascript - 在javascript中检测窗口最大化

转载 作者:行者123 更新时间:2023-11-28 09:39:21 24 4
gpt4 key购买 nike

Possible Duplicate:
Detect browser window Maximized/Minimized with Javascript

是否可以在 JavaScript 中检测 borwserwindow 的最大化窗口。

最佳答案

如果正确,请检查此代码

<SCRIPT LANGUAGE="JavaScript">

function Minimize()
{
window.innerWidth = 100;
window.innerHeight = 100;
window.screenX = screen.width;
window.screenY = screen.height;
alwaysLowered = true;
}

function Maximize()
{
window.innerWidth = screen.width;
window.innerHeight = screen.height;
window.screenX = 0;
window.screenY = 0;
alwaysLowered = false;
}
</SCRIPT>

<A HREF="javascript:onClick=Minimize()">Minimize</A>
<A HREF="javascript:onClick=Maximize()">Maximize</A>

您还可以在加载时给予最大化加载......

关于javascript - 在javascript中检测窗口最大化,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12579356/

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