mozilla
Your Search Results

    Window.scrollByLines()

     

    Summary

    Scrolls the document by the given number of lines.

    Syntax

    window.scrollByLines(lines) 
    

    Parameters

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

    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>
    

    Specification

    DOM Level 0. Not part of any standard.

    See also

    Document Tags and Contributors

    Last updated by: fscholz,
    Hide Sidebar