问题
Is there a Javascript or jQuery method to minimize the current browser window?
回答1:
There is no way to minimize the browser window within javascript.
There are ways to change the size of the window, but no true minimization (nice word)
回答2:
No, there isn't. However, depending on what you're doing and which browsers you're targeting, you could play around with the blur and focus events of the window to achieve similar effect.
回答3:
If you use an extension, then you can minimize by chrome.windows.update(window.id, { state: 'minimized' })
回答4:
I hope this is what you are looking for:
<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>
来源:https://stackoverflow.com/questions/601790/minimize-browser-window-using-javascript