研究调查问卷:请告诉我们您使用 Blockly 的体验
开始调查问卷
Move
可以使用三种不同的方法移动 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
。
轮子
确定是否可使用鼠标滚轮滚动工作区。如果 scrollbars
为 false
,则始终为 false
(至少在选项解析中)。默认设置为 false
。
如未另行说明,那么本页面中的内容已根据知识共享署名 4.0 许可获得了许可,并且代码示例已根据 Apache 2.0 许可获得了许可。有关详情,请参阅 Google 开发者网站政策。Java 是 Oracle 和/或其关联公司的注册商标。
最后更新时间 (UTC):2023-12-01。
[null,null,["最后更新时间 (UTC):2023-12-01。"],[[["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"]]