blockly > Scrollbar > setOrigin
مبدا فضای کاری را که نوار پیمایش در آن قرار دارد، بر حسب پیکسل نسبت به مبدا div تزریقی ثبت کنید. این برای مواقعی است که از نوار پیمایش در شیئی استفاده می شود که منشأ آن با فضای کار اصلی یکسان نیست (مثلاً در یک پرواز).
امضا:
setOrigin(x: number, y: number): void;
پارامترها
پارامتر | تایپ کنید | توضیحات |
---|
x | شماره | مختصات x مبدا نوار اسکرول، در پیکسل های CSS. |
y | شماره | مختصات y مبدا نوار اسکرول، در پیکسل های CSS. |
برمی گرداند:
باطل
جز در مواردی که غیر از این ذکر شده باشد،محتوای این صفحه تحت مجوز Creative Commons Attribution 4.0 License است. نمونه کدها نیز دارای مجوز Apache 2.0 License است. برای اطلاع از جزئیات، به خطمشیهای سایت Google Developers مراجعه کنید. جاوا علامت تجاری ثبتشده Oracle و/یا شرکتهای وابسته به آن است.
تاریخ آخرین بهروزرسانی 2025-01-10 بهوقت ساعت هماهنگ جهانی.
[null,null,["تاریخ آخرین بهروزرسانی 2025-01-10 بهوقت ساعت هماهنگ جهانی."],[[["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"]]