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 />

<br />

Select “Welcome” heading font point size:<br />

<br />

12<br />

14<br />

18<br />

24<br />

32<br />

48<br />

<br />

<br />

<br />

<br />

<br />

OK&nbsp;&nbsp;<br />

Cancel&nbsp;&nbsp;<br />

Apply<br />

<br />

<br />

<br />

The biggest design challenge you probably face with respect to these windows is<br />

deciding between a modal and modeless dialog box style. Some designers insist<br />

that modality has no place in a graphical user interface; others say that there are<br />

times when you need to focus the user on a very specific task before any further<br />

processing can take place. That’s where a modal dialog box makes perfect sense.<br />

sizeToContent()<br />

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

Compatibility ✓<br />

Example<br />

Use The Evaluator (Chapter 13 in the <strong>JavaScript</strong> <strong>Bible</strong>) in NN6 to try the<br />

sizeToContent() method. Assuming that you are running The Evaluator from the<br />

Chap13 directory on the CD-ROM (or the directory copied as-is to your hard disk),<br />

you can open a subwindow with one of the other files in the directory, and then size<br />

the subwindow. Enter the following statements into the top text box:<br />

a = window.open(“lst13-02.htm”,””)<br />

a.sizeToContent()<br />

The resized subwindow is at the minimum recommended width for a browser window,<br />

and at a height tall enough to display the little bit of content in the document.<br />

187<br />

windowObject.sizeToContent()

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

Saved successfully!

Ooh no, something went wrong!