ScrollBox.getHorizontalScroll

Syntax

getHorizontalScroll();

Description

The getHorizontalScroll method returns horizontal scrollbar of the ScrollBox component.

Example

To execute the example, the HEAD tag must include links to the PP.js library and to the PP.css visual styles table. Add an area that contains scrollbars to the HTML page.

<body>
<!--Place the ScrollBox component ans determine its parameters-->
<div id="scrollholder1" style="top: 10px; left: 10px; position: absolute;
        width: 250px; height: 350px; overflow:auto; margin-right: 50px;">
<!--Place text area inside the ScrollBox component, determine its sizes-->
        <div style='width: 300px; height: 700px'>
            <b>ScrollBox in DIV</b>
                  </div>
        </div>
    <script type="text/javascript">
        var ScrBox= new PP.Ui.ScrollBox({
            ParentNode: document.body,
            Content: document.getElementById("scrollholder1"),
            Width: 258,
            Height: 355
        });
        ScrBox.getHorizontalScroll().setDraggerMinSize(20);
        ScrBox.getVerticalScroll().setDraggerMinSize(20);
        ScrBox.scrollTo(1, 1);
</script>
</body>

After executing the example a text area is placed to the HTML page: contents of the div tag with the size much greater than scrollbar size. Thus scrollbar sliders are set to the minimum specified size: that is, 20 pixels. Using the scrollTo method, scrollbar sliders are shifted by one.

See also:

ScrollBox