แบบสำรวจการวิจัย: บอกให้เราทราบเกี่ยวกับประสบการณ์การใช้งาน Blockly
เริ่มแบบสำรวจ
blockly > FieldImage > setOnClickHandler
เมธอด FieldImage.setOnClickHandler()
ตั้งค่าฟังก์ชันที่จะเรียกใช้เมื่อคลิกรูปภาพนี้
ลายเซ็น:
setOnClickHandler(func: ((p1: FieldImage) => void) | null): void;
พารามิเตอร์
พารามิเตอร์ |
ประเภท |
คำอธิบาย |
func |
(p1: FieldImage) => เป็นโมฆะ) | ค่าว่าง |
ฟังก์ชันที่เรียกใช้เมื่อมีการคลิกรูปภาพ หรือ Null เพื่อนำออก |
การคืนสินค้า:
เป็นโมฆะ
เนื้อหาของหน้าเว็บนี้ได้รับอนุญาตภายใต้ใบอนุญาตที่ต้องระบุที่มาของครีเอทีฟคอมมอนส์ 4.0 และตัวอย่างโค้ดได้รับอนุญาตภายใต้ใบอนุญาต Apache 2.0 เว้นแต่จะระบุไว้เป็นอย่างอื่น โปรดดูรายละเอียดที่นโยบายเว็บไซต์ Google Developers Java เป็นเครื่องหมายการค้าจดทะเบียนของ Oracle และ/หรือบริษัทในเครือ
อัปเดตล่าสุด 2024-08-22 UTC
[null,null,["อัปเดตล่าสุด 2024-08-22 UTC"],[[["The `setOnClickHandler` method allows you to assign a function that will be executed when the FieldImage is clicked."],["This function can be set to `null` to remove any existing click handler."],["The assigned function receives the FieldImage instance as an argument when invoked."]]],["The `setOnClickHandler` method within the `FieldImage` class sets a function to be executed when an image is clicked. It accepts a single parameter, `func`, which can be a function taking a `FieldImage` object as input or `null` to remove any existing click handler. This method has no return value. The provided function is activated upon a user clicking the associated image within the interface.\n"]]