با مجموعهها، منظم بمانید
ذخیره و طبقهبندی محتوا براساس اولویتهای شما.
blockly > utils > browserEvents > conditionalBind
تابع ()utils.browserEvents.conditionalBind
یک کنترل کننده رویداد را که اگر بخشی از جریان لمسی فعال نباشد، نادیده گرفته شود، متصل کنید. از این برای رویدادهایی استفاده کنید که یک حرکت چند قسمتی را شروع میکنند یا ادامه میدهند (مثلاً ماوس یا حرکت ماوس، که ممکن است بخشی از کشیدن یا کلیک باشد).
امضا:
export declare function conditionalBind(node: EventTarget, name: string, thisObject: object | null, func: Function, opt_noCaptureIdentifier?: boolean): Data;
پارامترها
پارامتر | تایپ کنید | توضیحات |
---|
گره | رویداد هدف | گره ای که باید به آن گوش داد. |
نام | رشته | نام رویداد برای گوش دادن (مثلاً 'mousedown'). |
این شی | شی | تهی | مقدار "this" در تابع. |
تابع | تابع | عملکرد برای تماس زمانی که رویداد فعال می شود. |
opt_noCaptureIdentifier | بولی | (اختیاری) درست است اگر راهاندازی در این رویداد نباید اجرای سایر کنترلکنندههای رویداد را در این لمس یا سایر لمسهای همزمان مسدود کند. به طور پیش فرض نادرست است. |
برمی گرداند:
داده ها
داده های غیر شفافی که می توانند به unbindEvent_ ارسال شوند.
جز در مواردی که غیر از این ذکر شده باشد،محتوای این صفحه تحت مجوز Creative Commons Attribution 4.0 License است. نمونه کدها نیز دارای مجوز Apache 2.0 License است. برای اطلاع از جزئیات، به خطمشیهای سایت Google Developers مراجعه کنید. جاوا علامت تجاری ثبتشده Oracle و/یا شرکتهای وابسته به آن است.
تاریخ آخرین بهروزرسانی 2025-05-16 بهوقت ساعت هماهنگ جهانی.
[[["درک آسان","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 بهوقت ساعت هماهنگ جهانی."],[[["`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"]]