blockly > Scrollbar > set
Set the scrollbar handle's position.
Signature:
set(value: number, updateMetrics?: boolean): void;
Parameters
Parameter |
Type |
Description |
value |
number |
The content displacement, relative to the view in pixels. |
updateMetrics |
boolean |
(Optional) Whether to update metrics on this set call. Defaults to true. |
Returns:
void
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2024-09-18 UTC.
[null,null,["Last updated 2024-09-18 UTC."],[[["The `Scrollbar.set()` method positions the scrollbar handle based on content displacement."],["It accepts a numeric `value` representing the content's pixel displacement relative to the view and an optional boolean `updateMetrics` to control metric updates, defaulting to true."],["Calling `Scrollbar.set()` does not return any value."]]],["The `Scrollbar.set()` method positions the scrollbar handle. It accepts two parameters: `value`, a numerical representation of the content's displacement in pixels, and an optional boolean `updateMetrics`, which defaults to true and determines if metrics should be updated. The method returns no value (`void`). The `value` parameter is required to indicate the new handle position.\n"]]