PDA

View Full Version : Disable the maximize option



bbilal
10-24-2007, 01:28 PM
I have a ready made page and I just wanted to disable the maximize option of internet explorer and want to make the size of my wish of that page like a popup how I do it?

boogyman
10-24-2007, 02:14 PM
if this is an initial window then its usually not very well advised to mess with the width options like that.

put below in your <head> tags


<script type="text/javscript">
function resizeWin(var width = 0, var height = 0) {
if(width <= 0) { width = screen.availWidth; }
if(height <= 0) { height = screen.availHeight; }
self.resizeTo(width,height);
self.
}
</script>




<body onload = "resizeWin(760, 600)">

where 760 is the desired width that you want and 600 is the desired height that you want.
note the script allows for 1 or both arguments to be omitted which will cause window to use the available width / height of the screen.

I am not sure other than using the window.open method of disabling those features but if that is what you would like, then i suggest you do not use the script above, but rather


function resizeWin(var url = '', var width = 0, var height = 0) {
var newWin = window.open(url, newWin, "width="+width+",height="+height+",resize=0");
newWin.focus();
}
</script>

jscheuer1
10-24-2007, 02:17 PM
<a href="my_page.htm"
onclick="window.open(this.href,'_new','width=300, height=350');return false;">Link Text</a>

Not all browsers will allow it to be non-resizable. IE will, though.

bbilal
10-24-2007, 02:19 PM
I have to put this code in body or in head?

jscheuer1
10-24-2007, 02:19 PM
If you are referring to my response no, it is an ordinary link.

bbilal
10-24-2007, 02:28 PM
What's your msn id sir?

tech_support
10-26-2007, 10:18 AM
It goes in the body... like the rest of the page stuff.
http://www.dynamicdrive.com/forums/showthread.php?p=114338