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"?> ...

Get Practical Web Technologies now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.