问题
I integrated fullcalendar within a webpage but for some reason, the height I applied through the 'height' property available within the plugin only works for MonthView.
The code:
var calendarOptions = {
theme: true,
defaultView: 'agendaWeek',
allDaySlot: false,
allDayText: 'all-day',
height: ($(window).height()) - ($("div.calendarTitle").offset().top),
firstHour: 7,
firstDay: 1,
slotMinutes: 30,
defaultEventMinutes: 120,
axisFormat: 'H:mm',
.....
Basically, the ($(window).height()) - ($("div.calendarTitle").offset().top)
is intended to cover the given area.
I would like to know whether anybody else experienced this issue or has any idea about how I can overcome it. All I want is to get the same height, regardless of month view, day view or week view.
Right now, week and day view cover 70% of the page.
回答1:
Have you tried dynamically setting it after initialization?
$('#calendar').fullCalendar('option', 'height', 700);
FullCalendar Documentation
Another approach (for DayView) is provided in this question's answers on stack.
You can also try an approach like this (the last entry) for WeekView.
来源:https://stackoverflow.com/questions/13346295/fullcalendar-jquery-plugin-height-issue