移動
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
。
除非另有註明,否則本頁面中的內容是採用創用 CC 姓名標示 4.0 授權,程式碼範例則為阿帕契 2.0 授權。詳情請參閱《Google Developers 網站政策》。Java 是 Oracle 和/或其關聯企業的註冊商標。
上次更新時間:2023-12-01 (世界標準時間)。
[null,null,["上次更新時間: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"]]