View Full Version : Window object parameters
Klets
11-22-2004, 01:33 AM
Hi There,
I would like to open a window with a specified width and height. I know how to control a second window from the first on, but that is not what I mean.
What would like to have is that the first or current window changes in width and height. Is that possible? How?
Thanks
Klets.
hunter
11-23-2004, 08:20 AM
Please give me more explanation.
Do you want to resize the current window by clicking a link or button or something else that triggers an event?
Klets
11-23-2004, 03:33 PM
Thanks for responding Hunter,
I want the window to open in a specified size. If anyone is opening that HTML page, the window will automatiicaly adjust to the specified width and height. That is without any action from the user.
Is that possible?
Thanks,
Klets
hunter
11-24-2004, 02:50 AM
Everything is possible Dude! ;)
There is a methos for winodw object called [FONT=Comic Sans MS]resizeTo(iWidth,iHeight)[/FONT] which sets the size of the window to the specified width and length. Check the following simple script:
[FONT=Comic Sans MS][COLOR=DarkGreen]<HTML>
<HEAD>
<Script language="javascript">
function resizeWin(){
window.resizeTo(width,Height);
}
</script>
</HEAD>
<BODY onload="resizeWin(300,300)">
</Body>
</HTML>[/COLOR][/FONT]
When the page loads onload event is triggered and calls the resizeWin function defined in the Head section and it resizes the current window.
you can also use other events such as onClick, onMouseOver, ... for different purposes
Klets
11-25-2004, 05:02 AM
Thanks man,
Exactly what I needed! :D
Cheers,
Klets
hunter
11-25-2004, 12:14 PM
Nice to hear that.
Have fun!
vBulletin v3.0.3, Copyright ©2000-2010, Jelsoft Enterprises Ltd.