将fullcalendar居中至当天

时间:2016-04-06 07:12:39

标签: javascript jquery fullcalendar


有可能将当前日期的日历居中吗?

我的代码如下:

<div id='calendar'></div>

$("#calendar").fullCalendar({
    height: 135
}) 

$('.fc-view-container').animate({
  scrollTop: $(".fc-today").offset().top
}, 2000); 

JSFIDDLE

但是,上面提到的方法不起作用,我做错了吗?

问候!

1 个答案:

答案 0 :(得分:1)

尝试使用此

$('.fc-scroller').animate({
  scrollTop: $(".fc-today").offset().top
}, 2000);

您需要使用正确的选择器。

Updated fiddle