• 0

HTML code to disable maximize


Question

I'm currently messing around making a small website and I have used the HTML code to resize the users browser to fit the website;

<body onload=" moveTo(300,50); resizeTo(440,640)

Is there a code so that it disables the users Maximize button of the browser? As the website looks silly in full screen.

I'm a bit of a novice when it comes to web design and as I said, it's just a mess around website going to be hosted from home.

p.s. please don't come into this post and start shouting off on how stupid I am for doing this, as stated... IT'S JUST FOR FUN. Thanks in advance.

Link to comment
Share on other sites

14 answers to this question

Recommended Posts

  • 0

Not gonna say your stupid or anything, but please, please don't do things like this.

There are few things I hate more than a new window opening up, browser being resized ( and not able to resize ), and removing tool/menu bars..

If you want your website to be 440x640 ( or whatever ), then make a div, center it on the page, and work from there.. Leave it up to the user if they want their windows maximized or not..

Personally speaking, when I come to sites that do stuff like that, unless I HAVE to be there, I just leave.. I always have my windows maximized and it irks me when I site does stuff beyond it's little 'window' in the browser.. ( same thing with sites that open links/pages in new windows.. I can center click/right click if I want a new window/tab thanks, I don't need one forced upon me )

Link to comment
Share on other sites

  • 0

If you want your website to be 440x640 ( or whatever ), then make a div, center it on the page, and work from there.. Leave it up to the user if they want their windows maximized or not..

+1

This is why web development should be a licensed profession.

-1, gotta learn somewhere

Link to comment
Share on other sites

  • 0

This is why web development should be a licensed profession.

Sigh. Maybe this is why people like you should give advice on how to better the situation rather than making senseless comments. Explain to him why forcing a browser resize isn't a good idea or what he can do instead.

  • Like 2
Link to comment
Share on other sites

  • 0

A quick google search gave me this

on (release) {

getURL ("javascript:window.open('http://www.yoursite.com','WindowName',

'width=800,height=600,top=0,left=0,toolbar=no,scro llbars=no,resizable=no,menubar=no,status=no,direct ories=no,location=no'); void(0);");

}

http://board.flashkit.com/board/showthread.php?t=271987

http://www.google.com/#sclient=psy&hl=en&q=html+disable+maximize&aq=0v&aqi=g-v4g-o1&aql=&oq=&gs_rfai=&pbx=1&fp=e8de98ca5b405b41

Link to comment
Share on other sites

  • 0

I don't believe there is a way to manipulate any of the basic window controls on the browser window.

A better way to attack this problem would be a mix of HTML and CSS to create a fixed width DIV element for the main content of your page and center that DIV as has been suggested already. For example:


&lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"&gt;
&lt;html xmlns="http://www.w3.org/1999/xhtml"&gt;

&lt;head&gt;
&lt;meta content="text/html; charset=utf-8" http-equiv="Content-Type" /&gt;
&lt;title&gt;All my page content goes here&lt;/title&gt;
&lt;style type="text/css"&gt;
body {
	text-align:center;
}
.pageContent {
	width: 640px;
	height: 440px;
	border:thin black dotted;
	text-align:left;
	margin-left:auto;
	margin-right:auto;
}
&lt;/style&gt;
&lt;/head&gt;

&lt;body&gt;
&lt;div class="pageContent"&gt;&lt;p&gt;All my page content goes here...&lt;/p&gt;&lt;/div&gt;
&lt;/body&gt;

&lt;/html&gt;

Hope this helps.

Link to comment
Share on other sites

  • 0

The question really isn't how but rather that the aesthetics of the design look awkward with larger resolutions. Centering it within the browser isn't going to make a difference if it's already very small in width/height. It can be left (or right) aligned and it will still look awkward.

Link to comment
Share on other sites

  • 0

The question really isn't how but rather that the aesthetics of the design look awkward with larger resolutions. Centering it within the browser isn't going to make a difference if it's already very small in width/height. It can be left (or right) aligned and it will still look awkward.

When it comes to aesthetics, the centered DIV approach for fixed width content is pretty much an accepted standard in many site designs. I tend to agree with you, however, that not using content that is scalable is a bad design decision, but that's really up to the designer to decide.

Link to comment
Share on other sites

  • 0

A quick google search gave me this

on (release) {

getURL ("javascript:window.open('http://www.yoursite.com','WindowName',

'width=800,height=600,top=0,left=0,toolbar=no,scro llbars=no,resizable=no,menubar=no,status=no,direct ories=no,location=no'); void(0);");

}

http://board.flashkit.com/board/showthread.php?t=271987

http://www.google.com/#sclient=psy&hl=en&q=html+disable+maximize&aq=0v&aqi=g-v4g-o1&aql=&oq=&gs_rfai=&pbx=1&fp=e8de98ca5b405b41

The only flags that apply (in Firefox at least) are width, height, top and left. Browsers have moved away from giving sites this level of control, for the simple reason is that it takes it away from the user. And I can't even get that code to work in IE.

Link to comment
Share on other sites

  • 0

Thanks for the comments guys, I love the way some came in to just flame me even though I clearly stated in my original post that it was going to be a mess around website, I'm also trying to learn different HTML.

Maybe you should have to become a licensed profession to post of Internet forums... :whistle: or maybe just learn to read.

Thanks for the tips though, I've been trying all kinds of codes, but I may just centre my website and put it in a table with a nice border around it.

Link to comment
Share on other sites

  • 0

There's no way, afaik. What you can do is open a new window, disable resizing, set the size, and then the only way to change the size is to maximize it, which probably the user won't do.

Link to comment
Share on other sites

This topic is now closed to further replies.
  • Recently Browsing   0 members

    • No registered users viewing this page.