scrollY property

int scrollY
@DocsEditable(), @DomName('Window.scrollY')

The distance this window has been scrolled vertically.

Other resources

The Screen interface specification from W3C. scrollY from MDN.

Implementation

@DomName('Window.scrollY')
@DocsEditable()
int get scrollY => JS('bool', '("scrollY" in #)', this)
    ? JS('num', '#.scrollY', this).round()
    : document.documentElement.scrollTop;