Is there a Javascript or jQuery method to minimize the current browser window?
4 Answers
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)
1 Comment
James Cazzetta
Really nice word, cheers to that!
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.
1 Comment
chovy
can you describe your method?
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>
3 Comments
webketje
When you state reference code, please consider adding the reference instead of appropriating the intellectual rights to yourself. This answer's code is literally taken from a nr.1 Google Search on "js to minimize windows", at htmlgoodies.com/beyond/javascript/article.php/3471151/…
MaKR
I'll plagiarize yet another section of the same page: "This is an effect I have been using for a short while on some other sites I've worked on, and I thought it might make a nice tutorial. I'm really sorry to say that at the time of this tutorial (7/28/00 - Kathie Lee's last day with Regis) it only works on Netscape Navigator 4.0 and above." Netscape Navigator 4.0 is not a good target browser for your code. This is a deprecated 13 year old "solution".
Wali
This doesn't even work in all the browsers. Very poor answer.