DayPilot.Scheduler.scrollTo

The scrollTo() method sets the horizontal scrollbar position of the JavaScript Scheduler to the specified date/time or pixel position.

Declaration

DayPilot.Scheduler.scrollTo(date | pixels[, animated[, position]]);

Parameters

  • date (string in ISO 8601 format | DayPilot.Date) - target date/time

  • pixels (number) - target horizontal position in pixels

  • animated ("fast" | "normal" | "slow" | "linear") - scrolling animation; use null for no animation and "linear" to adjust speed based on distance

  • position ("left" | "middle" | "right") - target position of date within the viewport; the default is "left"

Notes

The move to the target position can be animated using the animated parameter.

You can control where the target date/time appears in the viewport using the position parameter.

When infinite scrolling is enabled, the Scheduler shifts the timeline automatically if the target date isn't in the current timeline.

Example

Scroll to the current time.

dp.scrollTo(DayPilot.Date.now());

Scroll to January 1, 2025.

dp.scrollTo("2025-01-01");

See Also

DayPilot.Scheduler.setScrollX()

DayPilot.Scheduler.getScrollX()

DayPilot.Scheduler.scrollToResource()

Infinite Scrolling [doc.daypilot.org]

Scheduler Scrolling Demo

DayPilot.Scheduler Class

Availability

Availability of this API item in DayPilot editions:

LitePro
DayPilot for JavaScript