• Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint
Share this Page URL
Help

Chapter 12. Learning About Your Environm... > Finding the Page's Scroll Position

Finding the Page's Scroll Position

CSS positioning works on the basis of offsetting an object from the top and left corners of the page when it loads. If the page scrolls down, however, the origin (top-left corner) scrolls along with it. Fortunately, you can ask the browser how far down or over it has scrolled (Figure 12.16).

Figure 12.16. An alert appears to tell you how the page has been scrolled, in pixels.



PREVIEW

                                                                          

Not a subscriber?

Start A Free Trial


  
  • Creative Edge
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint