0
A
回答
1
- 使用jquery或其他方法来收听滚动事件。 Look here for example
- 使用next和previous方法。
如果您只想在某个视图(即月视图)上允许滚动,则可以使用getView方法来检查您当前所处的视图。
+1
thanx!我需要使用“鼠标滚轮”事件,因为“滚动”仅在滚动条滚动时触发。我没有滚动条,因为日历总是调整大小以适合屏幕。而为了记录,目前的fullcalendar版本使用fullcalendar('prev')和fullcalendar('next')来切换视图。 – Weissvonnix 2014-10-10 21:11:13
0
这里是JS代码具有无限滚动在fullCalendar调度程序:
$(document).ready(function() {
$('#calendar').fullCalendar({
header: {
left: 'today prev,next',
center: 'title',
right: 'timelineDay,timelineFiveDays,timelineWeek,timelineMonth,timelineYear'
},
defaultView: 'timelineDay',
views: {
timelineFiveDays: {
type: 'timeline',
duration: { days: 5 }
}
},
eventOverlap: false, // will cause the event to take up entire resource height
resources: [
{ id: 'b', title: 'Bureau Information', children: [
{ id: 'b1', title: 'Bureau 1', eventColor: '#127F00' },
{ id: 'b2', title: 'Bureau 2', eventColor: '#66FF4C' }
] },
{ id: 'c', title: 'Cabines', children: [
{ id: 'c1', title: 'Cabine 1', eventColor: '#02417F' },
{ id: 'c2', title: 'Cabine 2', eventColor: '#51A9FF' }
] },
{ id: 'e', title: 'Events centre', children: [
{ id: 'e2', title: 'Un seul RDV cabine', eventColor: '#FFD753' },
{ id: 'e3', title: 'Un seul RDV info', eventColor: '#FFC607' },
{ id: 'e4', title: 'Aucun RDV cabine', eventColor: '#7F6C2A' },
{ id: 'e5', title: 'Aucun RDV info', eventColor: '#CC9E05' },
{ id : 'e6', title: 'Fermetue exceptionnelle', eventColor: '#7F6303' },
{ id: 'e7', title: 'Vacances', eventColor: '#FFD753' },
{ id: 'e8', title: 'Autre', eventColor: '#FFC607' }
] }
],
events: [
{ id: '1', resourceIds: ['b1','p3'], start: '2016-05-07T09:00:00', end: '2016-05-07T10:00:00', title: 'Marie Dupont' },
{ id: '2', resourceIds: ['c1','p1'], start: '2016-05-07T10:00:00', end: '2016-05-07T10:30:00', title: 'Léa Durand' },
{ id: '3', resourceIds: ['c2','p2'], start: '2016-05-07T10:00:00', end: '2016-05-07T11:30:00', title: 'Julie Martin' }
]
});
//console.log("before bind");
$(".fc-scroller:nth-child(1)").bind('scroll', function(event) {
console.log($(this).scrollLeft()+" --- "+$(this).innerWidth()+" --- "+$(this)[0].scrollWidth);
if($(this).scrollLeft() <= 0) {
//left scroll : end reached
$('#calendar').fullCalendar('prev');
}
if($(this).scrollLeft() + $(this).innerWidth() >= $(this)[0].scrollWidth) {
//right scroll : end reached
$('#calendar').fullCalendar('next');
}
});
//console.log("after bind");
});
和HTML:
<div id='calendar'></div>
相关问题
- 1. 12个月滚动
- 2. 在fullcalendar.js中使用PHP日期前一个月的条目
- 3. 6个月滚动数据
- 4. 滚动DatetimeIndex前进到下一个营业一个月的大熊猫
- 5. 如何在jQuery中滚动到下降
- 6. 在fullcalendar.js中修改日期
- 7. 获取本月到下5个月
- 8. SharePoint 2010滚动三个月日历
- 9. 12个滚动月份的MDX计算
- 10. SQL滚动3个月总有Yearmonth
- 11. 滚动后滚动到下一个锚点
- 12. 滚动到下一个类元素
- 13. 滚动到下一个可见元素
- 14. 滚动到下一个DIV从顶部
- 15. 自动滚动到下一个/上一个单元格滑动
- 16. 在AWT中添加一个滚动条/滚动条到框架
- 17. pyside - 在qscrollarea中自动向下滚动
- 18. jQuery滚动到顶部并滚动到下一部分
- 19. 动画滚动到下一个/上一个帖子
- 20. 下个月,当天在PHP
- 21. 找到下个月,上个月给出错误结果
- 22. 如果可选日期在下个月中打开,则下个月打开
- 23. 滚动条问题自动向下滚动到最后一个控件
- 24. 的strtotime1个月去过去下个月
- 25. 聊天框,自动滚动到下
- 26. JTable的自动滚动到下
- 27. 向下滚动页面自动直到用户滚动起来
- 28. 在FullCalendar.js的28天周期中添加活动
- 29. 使用javascript向下滚动到下一个元素
- 30. 向下滚动到下一个YouTube视频
你约'scrollTime'功能?请详细解释你想要的内容。 – dizel3d 2014-09-30 20:01:06
当用户处于Month-View时,我想要在用户向下滚动的下个月和用户向上滚动的上个月。 thanax! – Weissvonnix 2014-09-30 20:19:15