Calendar scroll speed
9 years ago.
Is there any method to change scroll speed on DayPilot Calendar? For now it's scrolling very slow and I'm forced to use left mouse button and grab scroll to scroll quickly to some hour...
Is there any method to change scroll speed on DayPilot Calendar? For now it's scrolling very slow and I'm forced to use left mouse button and grab scroll to scroll quickly to some hour...
It's using the default scrolling mechanism (a div with overflow: scroll). What system (OS, browser) do you use and how do you scroll (mouse wheel, touchpad gesture)?
Windows 10, Google Chrome. Every tab is scrolling like always, but only calendar inside scrolls 15 minutes after one full scroll.
Mouse wheel.
Do you see the problem here as well?
https://javascript.daypilot.org/demo/calendar/index.html
It seems to work fine for me (Windows 10, Chrome, mouse wheel).
No, this calendar works fine.
Look at my recorded video: https://streamable.com/om7bg
Do you synchronize those two calendars using a custom onscroll handler? That might be causing the problem. Try adding a delay using setTimeout() when changing the scroll position of the other calendar. Otherwise it might create a kind of circular dependency and block the UI.
<script type="text/javascript">
dp_day.nav.bottomRight.addEventListener("scroll", function() {
dp_week.nav.bottomRight.scrollTop = dp_day.nav.bottomRight.scrollTop;
dn_day.nav.bottomRight.scrollTop = dp_day.nav.bottomRight.scrollTop;
dn_week.nav.bottomRight.scrollTop = dp_day.nav.bottomRight.scrollTop;
});
dp_week.nav.bottomRight.addEventListener("scroll", function () {
dp_day.nav.bottomRight.scrollTop = dp_week.nav.bottomRight.scrollTop;
dn_day.nav.bottomRight.scrollTop = dp_week.nav.bottomRight.scrollTop;
dn_week.nav.bottomRight.scrollTop = dp_week.nav.bottomRight.scrollTop;
});
dn_day.nav.bottomRight.addEventListener("scroll", function () {
dp_week.nav.bottomRight.scrollTop = dn_day.nav.bottomRight.scrollTop;
dp_day.nav.bottomRight.scrollTop = dn_day.nav.bottomRight.scrollTop;
dn_week.nav.bottomRight.scrollTop = dn_day.nav.bottomRight.scrollTop;
});
dn_week.nav.bottomRight.addEventListener("scroll", function () {
dp_week.nav.bottomRight.scrollTop = dn_week.nav.bottomRight.scrollTop;
dp_day.nav.bottomRight.scrollTop = dn_week.nav.bottomRight.scrollTop;
dp_week.nav.bottomRight.scrollTop = dn_week.nav.bottomRight.scrollTop;
});
</script>@*ScrollBars*@
This is my code, so which calendars exactly do I have to timeout? Or can you simlply write those lines for me please?
Basically everything inside function() { .... }:
<script type="text/javascript">
dp_day.nav.bottomRight.addEventListener("scroll", function() {
setTimeout(function() {
dp_week.nav.bottomRight.scrollTop = dp_day.nav.bottomRight.scrollTop;
dn_day.nav.bottomRight.scrollTop = dp_day.nav.bottomRight.scrollTop;
dn_week.nav.bottomRight.scrollTop = dp_day.nav.bottomRight.scrollTop;
}, 0);
});
Do the same for all remaining event handlers as well.
It works now even worse than before.
Have you tried increasing the delay (from 0 to a higher value)?
You can also try to override onwheel event and set the position manually for all calendars.
Increased value to 50, doesn't work very well, but it's better than nothing. Thanks for help!
This question is more than 1 month old and has been closed. Please create a new question if you have anything to add.
DayPilot