Move
Blockly's main workspace can be moved around using three different methods: the
scrollbars, the mouse, or the mouse wheel.
The move settings are defined by an object that is part of
Blockly's configuration. Here is an example:
var workspace = Blockly.inject('blocklyDiv',
{move:{
scrollbars: {
horizontal: true,
vertical: true
},
drag: true,
wheel: false}
});
Determines if the workspace has vertical or horizontal scrollbars. Takes an
object where the horizontal
property determines if horizontal scrolling is
enabled and the vertical
property determines if vertical scrolling is enabled.
If a boolean is passed then it is equivalent to passing an object with both
horizontal
and vertical
properties set as that value. Defaults to true
(both horizontal and vertical scrolling enabled) if the workspace has
categories.
drag
Determines if the workspace can be dragged with the mouse. Always false
if
scrollbars
is false
(at least in options parsing). Defaults to true
if scrollbars
is true
.
wheel
Determines if the workspace can be scrolled with the mouse wheel. Always false
if scrollbars
is false
(at least in options parsing). Defaults to false
.
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."],[[["Blockly workspaces can be navigated using scrollbars, mouse dragging, and mouse wheel scrolling."],["These navigation options are configurable through Blockly's initialization options using the `move` property and its sub-properties: `scrollbars`, `drag`, and `wheel`."],["Scrollbars can be individually enabled or disabled for horizontal and vertical scrolling, while dragging and wheel scrolling are enabled or disabled with boolean values."]]],["Blockly's workspace movement is configured via the `move` object within its settings. This configuration allows defining the behavior of scrollbars, mouse dragging, and mouse wheel scrolling. `scrollbars` enables horizontal and/or vertical scrolling. `drag` enables mouse dragging, dependent on scrollbars being enabled. `wheel` enables mouse wheel scrolling, also dependent on scrollbars. Default settings include both scrollbars enabled and mouse dragging enabled, but mouse wheel disabled. If scrollbars are false then drag and wheel will be false as well.\n"]]