ScrollBar.MoveScroll

Syntax

MoveScroll: function (sender,args)

Parameters

sender. Event source.

args. Event information.

Description

The MoveScroll event occurs when the slider moves along the scrollbar.

Example

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

    <script type="text/javascript">
        var hScrollBar = new PP.Ui.ScrollBar({ //first scroll bar
            ParentNode: document.getElementById("scroll1")
        });
        //Size of the first scroll bar and its slider :
        hScrollBar.setSize(200, 16);
        hScrollBar.setDraggerSize(30);
        hScrollBar.updateSize();
        var vScrollBar = new PP.Ui.ScrollBar({//second scroll bar
            ParentNode: document.getElementById("scroll2")
        });
        //Size of the second scroll bar and its slider :
        vScrollBar.setDraggerSize(30);
        vScrollBar.setTop(23);
        vScrollBar.setSize(200, 16);
        vScrollBar.updateSize();
        //Add handler of the MoveScroll event:
        hScrollBar.MoveScroll.add(function (sender, args) {
            //Move the second scroll bar slider to the position of the first scroll bar slider:
            vScrollBar.scrollTo(hScrollBar.getValue());
        });
</script>

After executing the example the HTML page contains two instances of the ScrollBar component. On moving the slider of the component named hScrollBar, slider of the second component is moved to the same distance.

See also:

ScrollBar