Visit Mozilla.org

DOM:window.scrollByLines

From MDC

(Redirected from window.scrollByLines)

« Gecko DOM Reference

Contents

[edit] Summary

Scrolls the document by the given number of lines.

[edit] Syntax

window.scrollByLines(lines) 

[edit] Parameters

  • lines is the number of lines to scroll the document by.
  • lines may be a positive or negative integer.

[edit] Example

// scroll down the document by 5 lines.
<button onclick="scrollByLines(5);">down 5 lines</button>
// scroll up the document by 5 lines.
<button onclick="scrollByLines(-5);">up 5 lines</button>

[edit] Notes

See also window.scrollBy, window.scrollByPages.

[edit] Specification

DOM Level 0. Not part of specification.