研究调查问卷:请告诉我们您使用 Blockly 的体验
开始调查问卷
移动选项
使用集合让一切井井有条
根据您的偏好保存内容并对其进行分类。
您可以使用三种不同的方法移动 Blockly 的主要工作区:滚动条、鼠标或鼠标滚轮。
移动设置由 Blockly 配置选项中的对象定义。示例如下:
var workspace = Blockly.inject('blocklyDiv',
{move:{
scrollbars: {
horizontal: true,
vertical: true
},
drag: true,
wheel: false}
});
确定工作区是否具有垂直或水平滚动条。接受一个对象,其中 horizontal
属性用于确定是否启用水平滚动,vertical
属性用于确定是否启用垂直滚动。如果传递布尔值,则相当于传递一个将 horizontal
和 vertical
属性都设置为该值的对象。如果工作区包含类别,则默认为 true
(同时启用水平滚动和垂直滚动)。
拖动
确定是否可以使用鼠标拖动工作区。如果 scrollbars
为 false
,则始终为 false
(至少在选项解析中)。如果 scrollbars
为 true
,则默认为 true
。
wheel
确定是否可以使用鼠标滚轮滚动工作区。如果 scrollbars
为 false
,则始终为 false
(至少在选项解析中)。默认设置为 false
。
如未另行说明,那么本页面中的内容已根据知识共享署名 4.0 许可获得了许可,并且代码示例已根据 Apache 2.0 许可获得了许可。有关详情,请参阅 Google 开发者网站政策。Java 是 Oracle 和/或其关联公司的注册商标。
最后更新时间 (UTC):2025-06-13。
[[["易于理解","easyToUnderstand","thumb-up"],["解决了我的问题","solvedMyProblem","thumb-up"],["其他","otherUp","thumb-up"]],[["没有我需要的信息","missingTheInformationINeed","thumb-down"],["太复杂/步骤太多","tooComplicatedTooManySteps","thumb-down"],["内容需要更新","outOfDate","thumb-down"],["翻译问题","translationIssue","thumb-down"],["示例/代码问题","samplesCodeIssue","thumb-down"],["其他","otherDown","thumb-down"]],["最后更新时间 (UTC):2025-06-13。"],[[["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"]]