แบบสำรวจการวิจัย: บอกให้เราทราบเกี่ยวกับประสบการณ์การใช้งาน Blockly
เริ่มแบบสำรวจ
blockly > แถบเลื่อน > setOrigin
บันทึกต้นทางของพื้นที่ทำงานที่มีแถบเลื่อนอยู่ ในหน่วยพิกเซลที่สัมพันธ์กับต้นทาง div การแทรก ซึ่งจะเป็นกรณีที่มีการใช้แถบเลื่อนในออบเจ็กต์ที่มีต้นทางไม่ตรงกับพื้นที่ทำงานหลัก (เช่น ในการเลื่อนออก)
ลายเซ็น:
setOrigin(x: number, y: number): void;
พารามิเตอร์
พารามิเตอร์ |
ประเภท |
คำอธิบาย |
x |
ตัวเลข |
พิกัด x ของต้นทางแถบเลื่อน หน่วยเป็นพิกเซล CSS |
y |
ตัวเลข |
พิกัด y ของต้นทางของแถบเลื่อน หน่วยเป็นพิกเซล CSS |
การคืนสินค้า:
เป็นโมฆะ
เนื้อหาของหน้าเว็บนี้ได้รับอนุญาตภายใต้ใบอนุญาตที่ต้องระบุที่มาของครีเอทีฟคอมมอนส์ 4.0 และตัวอย่างโค้ดได้รับอนุญาตภายใต้ใบอนุญาต Apache 2.0 เว้นแต่จะระบุไว้เป็นอย่างอื่น โปรดดูรายละเอียดที่นโยบายเว็บไซต์ Google Developers Java เป็นเครื่องหมายการค้าจดทะเบียนของ Oracle และ/หรือบริษัทในเครือ
อัปเดตล่าสุด 2024-09-11 UTC
[null,null,["อัปเดตล่าสุด 2024-09-11 UTC"],[[["The `Scrollbar.setOrigin()` method is used to set the origin of a scrollbar relative to its containing workspace, particularly useful when the scrollbar is within elements like flyouts that have different origins."],["It takes two parameters, `x` and `y`, representing the horizontal and vertical coordinates of the scrollbar's origin in CSS pixels, respectively."],["This method records the workspace origin for the scrollbar, ensuring proper positioning and functionality even when used in elements outside the main workspace area."]]],["The `setOrigin` method of the `Scrollbar` class records the workspace's origin relative to the injection div. It's used when the scrollbar is within an object whose origin differs from the main workspace. This method takes two parameters: `x` and `y`, representing the x and y coordinates of the scrollbar's origin in CSS pixels. It does not return any value. The purpose is to allow a scrollbar to work properly, even if the origin of the workspace differs.\n"]]