透過集合功能整理內容
你可以依據偏好儲存及分類內容。
blockly > utils > browserEvents > conditionalBind
utils.browserEvents.conditionalBind() 函式
繫結事件處理常式,如果該事件處理常式不在有效的觸控串流中,則可忽略。請在開始或繼續多重手勢的事件中使用此事件 (例如 mousedown 或 mousemove,可能會是拖曳或點擊的一部分)。
Signature:
export declare function conditionalBind(node: EventTarget, name: string, thisObject: object | null, func: Function, opt_noCaptureIdentifier?: boolean): Data;
參數
參數 |
類型 |
說明 |
節點 |
EventTarget |
要監聽的節點。 |
名稱 |
字串 |
要監聽的事件名稱 (例如「mousedown」)。 |
thisObject |
object | null |
函式中的「this」值。 |
func |
函式 |
觸發事件時要呼叫的函式。 |
opt_noCaptureIdentifier |
布林值 |
(選用) 如果觸發此事件不應阻斷對此觸控或其他同時觸控的其他事件處理常式執行作業,則為是。預設為 False。 |
退貨:
資料
可傳遞至 unbindEvent_ 的非公開資料。
除非另有註明,否則本頁面中的內容是採用創用 CC 姓名標示 4.0 授權,程式碼範例則為阿帕契 2.0 授權。詳情請參閱《Google Developers 網站政策》。Java 是 Oracle 和/或其關聯企業的註冊商標。
上次更新時間:2025-07-25 (世界標準時間)。
[[["容易理解","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"]],["上次更新時間:2025-07-25 (世界標準時間)。"],[],["The `conditionalBind` function binds an event handler to a specified node. It takes the node, event name, a `this` object, the handler function, and an optional boolean to control blocking of other event handlers. When the event is triggered, the provided function is executed. This is intended for events related to multi-part gestures. It returns data used for unbinding the event later. This allows to control whether to block execution of other handlers for touches.\n"]]