Home / Advanced JavaScript Tutorials / Moving, scrolling, and resizing a window |
CodingForums Jump to...
- CSS Drive
- JavaScript Menus - PHP Resources - Hotels & Vacations - Java Online Casinos - Web hosting Search |
Same concept again, different action again. The new resizeBy() and resizeBy() methods of JavaScript1.2 allow you to programmatically resize the window. Here are the methods to accomplishing this:
Note that in NS 4, resizing a window to below 100 by 100 in pixels require permission using signed script (for security reasons). Let's cut straight to the chase now, and show some examples using them. Example #1: Resizing the window to fit the entire screen Here's a rather useful script that resizes the current window to fit the entire screen: <script> <form>
Note the moveTo() above, which first moves the window to the upper left corner of the screen before resizing... Example #2: Animated window opener One of the scripts found in the JavaScript Kit script archive demonstrates quite well how you may use the resize methods to create interesting window effects. Check out the effect, then the source: <script> Nothing in the above code should come as outrageously alienatic (is there such as word?) to you, so I'll leave it at that. And with that I also end this tutorial. Just one word of advice- as useful as these newly learned JavaScript methods can be, don't give them too much control over your page...manual is often times still the most practical! -Tutorial introduction |
. http://javascriptkit.com |