getTrackSize ();
The getTrackSize method gets width of the scrolled area.
Width of the scrolled area equals to the difference between width and height of the component. Thus, if scrollbar width = 100, and the height = 10, width of the scrolled area makes up 90 pixels.
To execute the example, connect links to the PP.js library and to the PP.css visual styles table. Create a scrollbar with a slider width of which equals to the distance between left and right scroll buttons.
<script type="text/javascript">
var hScrollBar = new PP.Ui.ScrollBar({
ParentNode: document.getElementById("scroll1")
});
hScrollBar.setSize(200, 16);
hScrollBar.setDraggerSize(hScrollBar.getTrackSize() - hScrollBar.getHeight());
</script>
After executing the example a scrollbar with a slider width of which equals to the distance between left and right scroll buttons is placed to the HTML page.
See also: