15.02.2013 Views

JavaScript Examples Bible - UserWorks Technologies

JavaScript Examples Bible - UserWorks Technologies

JavaScript Examples Bible - UserWorks Technologies

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Chapter 2 ✦ Window and Frame Objects (Chapter 16)<br />

alert(“Filling the table for “ + howMany) // for demo<br />

//statements that validate the entry and<br />

//actually populate the fields of the table<br />

}<br />

}<br />

<br />

<br />

<br />

<br />

<br />

<br />

<br />

<br />

<br />

Figure 2-8: The prompt dialog box displayed from<br />

Listing 16-29 (Windows format)<br />

Notice one important user interface element in Listing 16-29. Because clicking<br />

the button leads to a dialog box that requires more information from the user, the<br />

button’s label ends in an ellipsis (or, rather, three periods acting as an ellipsis character).<br />

The ellipsis is a common courtesy to let users know that a user interface element<br />

leads to a dialog box of some sort. As in similar situations in Windows and<br />

Macintosh programs, the user should be able to cancel out of that dialog box and<br />

return to the same screen state that existed before the button was clicked.<br />

resizeBy(deltaX,deltaY)<br />

resizeTo(outerwidth,outerheight)<br />

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

Compatibility ✓ ✓ ✓ ✓ ✓<br />

Example<br />

You can experiment with the resize methods with the page in Listing 16-30. Two<br />

parts of a form let you enter values for each method. The one for window.resize()<br />

also lets you enter a number of repetitions to better see the impact of the values.<br />

Enter zero and negative values to see how those affect the method. Also test the<br />

limits of different browsers.<br />

167<br />

windowObject.resizeBy()

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

Saved successfully!

Ooh no, something went wrong!