Forum Moderators: open
I've used this code in the <head> section:
<script type="text/javascript" language="javascript">
window.resizeTo(695,700);
</script>
This resizes the page every time it loads. Is there similar code which I can use to lock the size of the page on the x-axis but let the y-axis be resized what ever?
All help appreciated.
Cheers.
It's possible to lock both the x- and y-sizes when opening a new window:
<script language="JavaScript">
window.open('WindowURL','WindowName','[b]resizable=no[/b],width=695,height=700');
</script>
I'd be careful - people don't like being told how big their windows should be, and may be annoyed when they lose control over it.
Perhaps you could give us a bit more information about what this is for?
James.
The link will only active for 30 minutes so be quick.
I don't want to open it new, I just want it to 'do' it.
Nah it's not a trick site, it's just ugly with all the white space. I'll do something with it sooner or later, but I'm too busy coding at the present moment.
Cheers for the welcome.
[edited by: engine at 2:54 pm (utc) on June 18, 2004]
[edit reason] No urls, thanks. See TOS [webmasterworld.com] [/edit]
window.onresize = function()
{
this.resizeTo(695,getWinHeight())
}
This doesn't lock the window's width, but will make it snap back if resized. This is likely to make it even more irritating.
There is something I've left out:
getWinHeight(). If you want to leave the height alone, you need to know what it is to start with. The window outer dimension properties are browser-specific, and I'm not sure what they all are. You'd have to do the function yourself.
Brent.