/    Sign up×
Community /Pin to ProfileBookmark

automatically maximize a users screen.

For a class my website doesn’t work less than 800 by 600. My teacher wants it to work for everything. So I wanted to set the page to scroll side ways if it is to small but I couldn’t figure that out. So my question.

Is it possible to automatically maximize a users screen on the loading of the page? Not full screen but just maximized. If anyone can help thanks in advance.

[url]www.madddidley.com[/url] | momadddidley.madddidley.com

to post a comment
PHP

3 Comments(s)

Copy linkTweet thisAlerts:
@MstrBobSep 09.2004 — I'm not sure about that. However, I am sure that if it is possible, this would be client side scripting and not server side scripting. You're best bet is to ask in the Javascript lounge.
Copy linkTweet thisAlerts:
@HellspireSep 10.2004 — PHP has no function of this sort. It is the province of javascript.
Copy linkTweet thisAlerts:
@HaganeNoKokoroSep 10.2004 — Put this inside the head of your document:
<i>
</i>&lt;script type="text/javascript"&gt;
function reset() {
window.moveTo(0, 0);
window.resizeTo(screen.width, screen.height);
}
window.onresize=reset;
reset();
&lt;/script&gt;

This will resize the browser window to full size when the page is loaded, and if the user tries to resize, it will reset the screen window size to full.

Note that it will not work if the user has javascript disabled, and there may be some browsers that will not play ball (for example, in Netscape 7, if the user resizes from the left or top, the page is still resized to full, but not moved to the (0, 0) position). These, however, are inevitable pitfalls of client-side scripting.
×

Success!

Help @madddidley spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.2,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,

tipper: @Samric24,
tipped: article
amount: 1000 SATS,
)...