Home  >  Article  >  Web Front-end  >  jquery maximizes the window no matter what the situation_jquery

jquery maximizes the window no matter what the situation_jquery

WBOY
WBOYOriginal
2016-05-16 17:23:48966browse

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.

Copy code The code is as follows:

$(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:
Copy code The code is as follows:


< head>
hello








< object id=max classid="clsid:ADB880A6-D8FF-11CF-9377-00AA003B7A11">






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!
Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn