jQuery in Action
288
CHAPTER 9
Prominent, powerful, and practical plugins
commands, as well as three radio buttons that allow us to choose which target the
commands are applied to. We can choose the Window, the Document, or the Test
subject
commands are applied to. We can choose the Window, the Document, or the Test
subject
<div>
element. Note that we set the height and width of the
<body>
ele-
ment of the page to the ridiculous size of 2000 pixels square to force the window
to show scrollbars.
to show scrollbars.
The Apply button applies the specified values to the specified target, and the
Restore button sets the scroll values for all targets back to 0. Below the buttons, a
section shows the current values for the three targets in real time.
section shows the current values for the three targets in real time.
The Test subject pane contains the test subject: a 360 by 200 pixel
<div>
ele-
ment that contains an image that's much larger than can be displayed in that size.
Figure 9.6 The Scrolling Lab lets us observe the effects of the
scrollTop()
and
scrollLeft()
methods.