diff options
-rw-r--r-- | www/js/calendar.js | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/www/js/calendar.js b/www/js/calendar.js index 7f8696a..815c5d9 100644 --- a/www/js/calendar.js +++ b/www/js/calendar.js @@ -95,6 +95,7 @@ function calendar_init() { $('#btn-today').click(calendar_today); $('#btn-earlier').click(calendar_prev); $('#btn-later').click(calendar_next); + $('#calendar').on('wheel', calendar_scroll); current_week_offset = -4; clock.addCallback(function() { calendar_redraw(current_week_offset); @@ -115,3 +116,17 @@ function calendar_next() { current_week_offset++; calendar_redraw(current_week_offset) } + +function calendar_scroll(event) { + console.log(event.originalEvent.deltaY); + if(event.originalEvent.deltaY > 0) { + calendar_next(); + return false + } + + if(event.originalEvent.deltaY < 0) { + calendar_prev(); + return false + } + return false; +} |