Maximize browser window

JavaScript and client side scripting.

Moderator: General Moderators

Post Reply
desmondlk
Forum Commoner
Posts: 27
Joined: Tue Sep 24, 2002 10:27 pm
Location: Malaysia

Maximize browser window

Post by desmondlk »

Dear all,

May I know to maximize the browser window to fix the screen by using javascript?

Please help. Thanks in advance.
User avatar
volka
DevNet Evangelist
Posts: 8391
Joined: Tue May 07, 2002 9:48 am
Location: Berlin, ger

Post by volka »

try

Code: Select all

<html>
	<head>
	</head>
	<body>
		<script type="text/javascript">
			var nSW = screen.availWidth || screen.width;
			var nSH = screen.availHeight  || screen.height;
			window.moveTo(0,0);
			window.resizeTo(nSW, nSH);
		</script>
		test
	</body>
</html>
and please do not use it to bother somebody ;)
(my mozilla e.g. is blocking it)
User avatar
twigletmac
Her Royal Site Adminness
Posts: 5371
Joined: Tue Apr 23, 2002 2:21 am
Location: Essex, UK

Post by twigletmac »

volka wrote:and please do not use it to bother somebody ;)
(my mozilla e.g. is blocking it)
I really must play with Mozilla more - always end up in IE 'cause that's what the majority of testing at work has to be done in...

However, even without being able to block that sort of maximisation I do tend to immediately leave sites who force me to have my screen at a particular size unless I'm really, really interested in the content. Even then I'm unlikely to stick around for long.

Mac
Post Reply