DayPilot Knowledge Base

AJAX Calendar/Scheduling Controls
DayPilot Pro (AJAX Calendar Control)
» DayPilot AJAX Calendar
DayPilot Pro (AJAX Monthly Calendar Control)
» DayPilot AJAX Monthly Calendar
DayPilot Pro (AJAX Scheduler Control)
» DayPilot AJAX Scheduler
DayPilot » Knowledge Base » How to get the scrollbar position as date/time (client side)

How to get the scrollbar position as date/time (client side)

Last revision: Mar 8, 2010

Use the following code to get the scrollbar position as DayPilot.Date object using JavaScript (client side) in the Scheduler.

The horizontal scrollbar position can be detected using dps.getHScrollPosition() method.

var scrollX = dps.getHScrollPosition();

The first visible cell start time (DayPilot.Date object) can be extracted using dps.getDate() method:

var cellStart = dps.getDate(scrollX);

The exact time point can be extracted by adding a second parameter:

var scrollDateTime = dps.getDate(scrollX, true);

Controls: Scheduler

Related

How to get the scrollbar position as date/time (server side)
How to show cell Bubble using JavaScript
How to add an event to the scheduler on the client side (JavaScript)
How to detect time offset of mouse clicks inside an event