Stay organized with collections
Save and categorize content based on your preferences.
blockly > ScrollbarPair
Class for a pair of scrollbars. Horizontal and vertical.
Signature:
export declare class ScrollbarPair
Constructors
Properties
Methods
Method |
Modifiers |
Description |
canScrollHorizontally() |
|
Returns whether scrolling horizontally is enabled. |
canScrollVertically() |
|
Returns whether scrolling vertically is enabled. |
dispose() |
|
Dispose of this pair of scrollbars. Unlink from all DOM elements to prevent memory leaks. |
isVisible() |
|
If any of the scrollbars are visible. Non-paired scrollbars may disappear when they aren't needed. |
resize() |
|
Recalculate both of the scrollbars' locations and lengths. Also reposition the corner rectangle. |
resizeContent(hostMetrics) |
|
Recalculates the scrollbars' locations within their path and length. This should be called when the contents of the workspace have changed. |
resizeView(hostMetrics) |
|
Recalculates the scrollbars' locations on the screen and path length. This should be called when the layout or size of the window has changed. |
set(x, y, updateMetrics) |
|
Set the handles of both scrollbars. |
setContainerVisible(visible) |
|
Set whether this scrollbar's container is visible. |
setVisible(visible) |
|
Sets the visibility of any existing scrollbars. |
setX(x) |
|
Set the handle of the horizontal scrollbar to be at a certain position in CSS pixels relative to its parents. |
setY(y) |
|
Set the handle of the vertical scrollbar to be at a certain position in CSS pixels relative to its parents. |
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.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2024-09-18 UTC."],[[["The `ScrollbarPair` class manages a pair of horizontal and vertical scrollbars for a Blockly workspace."],["It provides methods for controlling the scrollbars' visibility, position, and size in response to workspace changes and user interactions."],["`ScrollbarPair` handles resizing and repositioning of scrollbars, ensuring they remain functional and aligned within their container."],["Developers can use its methods to set scroll positions, check visibility, and manage the overall behavior of the scrollbars."]]],[]]