סקר מחקר: נשמח לשמוע על החוויה שלך עם Blockly
לפתיחת הסקר
קל לארגן דפים בעזרת אוספים
אפשר לשמור ולסווג תוכן על סמך ההעדפות שלך.
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 |
בוליאני |
(אופציונלי) הערך true (נכון) אם ההפעלה של האירוע הזה לא אמורה לחסום את ההפעלה של אחרים מטפלי אירועים במגע הזה או במגעים בו-זמניים אחרים. ברירת המחדל היא False. |
החזרים:
נתונים
נתונים אטומים שאפשר להעביר אל unbindEvent_.
אלא אם צוין אחרת, התוכן של דף זה הוא ברישיון Creative Commons Attribution 4.0 ודוגמאות הקוד הן ברישיון Apache 2.0. לפרטים, ניתן לעיין במדיניות האתר Google Developers. Java הוא סימן מסחרי רשום של חברת Oracle ו/או של השותפים העצמאיים שלה.
עדכון אחרון: 2025-05-16 (שעון UTC).
[[["התוכן קל להבנה","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-05-16 (שעון UTC)."],[[["`utils.browserEvents.conditionalBind()` allows binding event handlers that can be selectively ignored based on touch stream activity, making it suitable for multi-part gestures like dragging or clicking."],["The function takes parameters for the target node, event name, function to execute, context (`this` value), and an optional flag to control blocking behavior."],["It returns an opaque data object that can be later used to unbind the event using `unbindEvent_`."]]],["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"]]