блочно > Полоса прокрутки > setOrigin
Запишите начало координат рабочей области, в которой находится полоса прокрутки, в пикселях относительно начала координат div-вставки. Это делается в тех случаях, когда полоса прокрутки используется в объекте, начало координат которого отличается от основного рабочего пространства (например, во всплывающем меню).
Подпись:
setOrigin(x: number, y: number): void;
Параметры
Параметр | Тип | Описание |
---|
х | число | Координата x начала полосы прокрутки в CSS-пикселях. |
й | число | Координата Y начала полосы прокрутки в CSS-пикселях. |
Возврат:
пустота
Если не указано иное, контент на этой странице предоставляется по лицензии Creative Commons "С указанием авторства 4.0", а примеры кода – по лицензии Apache 2.0. Подробнее об этом написано в правилах сайта. Java – это зарегистрированный товарный знак корпорации Oracle и ее аффилированных лиц.
Последнее обновление: 2025-01-10 UTC.
[null,null,["Последнее обновление: 2025-01-10 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"]]