ScrollBar.getIsMoved

Syntax

getIsMoved ();

Description

The getIsMoved method determines whether the slider moves along the scrollbar.

Comments

The getIsMoved method returns true if the slider is moving. Is the slider stands still, it returns False.

Example

To execute the example, connect the links to the PP.js library and to the PP.css visual styles table. Create a scrollbar named hScrollBar. Add a handler of the MoveScroll event for the scrollbar:

    <div id="scroll1"></div>
    <div id="label1"></div>
    <script type="text/javascript">
        var hScrollBar = new PP.Ui.ScrollBar({ // scrollbar
            ParentNode: document.getElementById("scroll1")
        });
        //Size of scrollbar and its slider:
        hScrollBar.setSize(200, 16);
        hScrollBar.setDraggerSize(30);
        hScrollBar.updateSize();
        //Add title
        var label = new PP.Ui.Label({
            ParentNode: "label1",
        Content: "Value"
        });
        label.setTop(30);
        //Add MoveScroll event handler:
        hScrollBar.MoveScroll.add(function (sender, args) {
            //Display current slider position in title:
            if (hScrollBar.getIsMoved() == true) { label.setContent(hScrollBar.getValue()) };
        });
</script>

After executing the example the HTML page contains an instance of the ScrollBar component. On dragging the slider with mouse the title displays the current slider position.

See also:

ScrollBar