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

<br />

<br />

<br />

Figure 2-9: Scripts control the scrolling of the top frame<br />

Notice that in the customScroll() function, <strong>JavaScript</strong> must convert the string<br />

values from the two text boxes to integers (with the parseInt() method) for the<br />

scroll() method to accept them. Nonnumeric data can produce very odd results.<br />

Also be aware that although this example shows how to adjust the scroll values in<br />

another frame, you can set such values in the same frame or window as the script,<br />

as well as in subwindows, provided that you use the correct object references to<br />

the window.<br />

scrollBy(deltaX,deltaY)<br />

scrollTo(x,y)<br />

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

Compatibility ✓ ✓ ✓ ✓ ✓<br />

171<br />

windowObject.scrollBy()

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

Saved successfully!

Ooh no, something went wrong!