jQuery FullCalendar - Can I programmatically resize the Calendar

空扰寡人 提交于 2019-12-11 08:48:24

问题


I'm using FullCalendar, and I realize that if the window is resized, FullCalendar's default is to handle the window resize and adjust the calendar as needed.

However, I have a slight problem when a nav sidebar is chosen to slide in/out, FullCalendar is left with some extra large weekend Saturdays. (See below). And the opposite is true when the Nav Sidebar slides back out. (The weekends become quite small).

The only remedy thus far has been to resize window, which then adjusts the calendar. But I don't want users to have to do this obviously.

Is there a way to programmatically resize/refresh the calendar size without resizing the window?

I have tried something like: $("#calendar").fullCalendar( 'windowResize' ); But this doesn't seem to work.

Any ideas on what I could do here?

Thanks!


回答1:


Dodinas as requested, the following worked for you for dynamically resizing the calendar.

http://arshaw.com/fullcalendar/docs/display/aspectRatio/

On initialize:

$('#calendar').fullCalendar({
    aspectRatio: 2
});

After initialize:

$('#calendar').fullCalendar('option', 'aspectRatio', 1.8);


来源:https://stackoverflow.com/questions/21519947/jquery-fullcalendar-can-i-programmatically-resize-the-calendar

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!