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/timepixels(number) - target horizontal position in pixelsanimated("fast"|"normal"|"slow"|"linear") - scrolling animation; usenullfor no animation and"linear"to adjust speed based on distanceposition("left"|"middle"|"right") - target position ofdatewithin 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]
Availability
Availability of this API item in DayPilot editions:
| Product | Lite | Pro |
|---|---|---|
| DayPilot for JavaScript |
DayPilot