简体   繁体   中英

jQuery FullCalendar - Can I programmatically resize the Calendar

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!

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);

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM