The Wayback Machine - https://web.archive.org/web/20080901163635/http://developer.mozilla.org:80/en/DOM/window.scrollY

Mozilla.com

  1. MDC
  2. Main Page
  3. DOM
  4. window.scrollY

Some features of this site require JavaScript.

window.scrollY

« Gecko DOM Reference

Summary

Returns the number of pixels that the document has already been scrolled vertically.

Syntax

var ypix = window.scrollY;

Parameters

  • ypix is the number of pixels.

Example

// make sure and go down to the second page 
if (window.scrollY)
  window.scroll(0,0);
window.scrollByPages(1);

Notes

Use this property to check that the document hasn't already been scrolled some if you are using relative scroll functions such as window.scrollBy, window.scrollByLines, or window.scrollByPages.

The pageYOffset property is an alias for the scrollY property:

window.pageYOffset == window.scrollY; // always true

Specification

DOM Level 0. Not part of specification.

Languages

Page last modified 06:46, 30 Dec 2007 by Waldo

Files (0)

 
 
 
Morty Proxy This is a proxified and sanitized view of the page, visit original site.