15.02.2013 Views

JavaScript Examples Bible - UserWorks Technologies

JavaScript Examples Bible - UserWorks Technologies

JavaScript Examples Bible - UserWorks Technologies

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

168<br />

<strong>JavaScript</strong> <strong>Examples</strong> <strong>Bible</strong>: The Essential Companion to <strong>JavaScript</strong> <strong>Bible</strong><br />

Listing 16-30: Window Resize Methods<br />

<br />

<br />

Window Resize Methods<br />

<br />

function doResizeBy(form) {<br />

var x = parseInt(form.resizeByX.value)<br />

var y = parseInt(form.resizeByY.value)<br />

var count = parseInt(form.count.value)<br />

for (var i = 0; i < count; i++) {<br />

window.resizeBy(x, y)<br />

}<br />

}<br />

function doResizeTo(form) {<br />

var x = parseInt(form.resizeToX.value)<br />

var y = parseInt(form.resizeToY.value)<br />

window.resizeTo(x, y)<br />

}<br />

<br />

<br />

<br />

<br />

Enter the x and y increment, plus how many times the window should be resized<br />

by these increments:<br />

Horiz:<br />

Vert:<br />

How Many:<br />

<br />

<br />

Enter the desired width and height of the current window:<br />

Width:<br />

Height:<br />

<br />

<br />

<br />

<br />

routeEvent(event)<br />

windowObject.routeEvent()<br />

Compatibility ✓<br />

NN2 NN3 NN4 NN6 IE3/J1 IE3/J2 IE4 IE5 IE5.5

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!