Fullcalendar jquery plugin height issue

寵の児 提交于 2019-12-11 06:55:03

问题


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

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