O'Reilly logo

Practical Web Technologies by V. Lau, P. K. Yuen

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

8.4. Browser window(s) II

8.4.1. Locating page objects with window scrolling

When dealing with browser controls (single or multiple windows), another useful function is window scrolling. Window scrolling moves the window to particular x,y coordinates. Consider the command

   <script> window.scroll(150,250)</script>

This moves the current window’s left top corner to the location (150, 250) measured by pixels. When working with multiple windows, window handles are often used as identities. In the next example, a page is developed to control the scrolling of a strip of pictures so that only one picture can be seen at any one time. The controlling page is listed in ex08-17.htm.

Example. ex08–17.htm – Window Scrolling I
 1: <?xml version="1.0" encoding="UTF-8"?> ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required