When opening a new window, some users want to directly maximize the display without taking another step. If you don't make explicit settings in the code, this is generally a problem with the browser's own settings. But the user hopes that no matter what the situation is, no matter what setting the browser is in, the pop-up window must be maximized, so what should be done? In fact, it's easy to do. We only need to add a few lines of code to change the browser window size from the default to our own settings.
$(function(){
if (window .screen) {
var myw = screen.availWidth;
var myh = screen.availHeight;
window.moveTo(0, 0);
window.resizeTo(myw, myh);
}
});
Coupled with some jquery operations, you can maximize the browser window.
The above method is actually not true maximization, it just adjusts the window to the maximum. The maximize button in the upper right corner is still a single box. After consulting a lot of information, I found that there is a method that can basically realize the complete Maximize:
The above code can be copied directly to a page with an extension of .html and run with IE browser (other browsers Not tested), whether you refresh or click the "maximize" button, you can fully maximize it.
So why do I need to add a basic implementation above? It’s because so far I have not fully achieved the maximum effect in actual applications. In other words, as long as the above code is copied to the server and run, even if it does not change at all, it will not work. Function, refresh or click the "maximize" button, all have no effect. For unknown reasons, I had to give up this method temporarily. Why?
I sincerely hope that all netizens can give me some advice!