FullCalendar auto-height in week view

北城以北 提交于 2019-12-01 03:09:22

Edit:

Fullcalendar v2.1.1

http://jsfiddle.net/3E8nk/560/

contentHeight: 'auto',

Solution for old versions?

Kind of hack:ish. Does this work in your environment? I used the code from your other question.

http://jsfiddle.net/3E8nk/558/

contentHeight: '9999',

Adjusting dynamically the height instead of the aspect ratio worked for me:

Asigning the calendar to a variable when initiating:

calendar = $('#calendar').fullCalendar({
    height: $(window).height()*0.83,
    ...
});

And then adjusting height dynamically (after checking that calendar exists already in order to avoid initial error messages):

if(calendar) {
  $(window).resize(function() {
    var calHeight = $(window).height()*0.83;
    $('#calendar').fullCalendar('option', 'height', calHeight);
  });
};

The factor *0.83 depends on your page-design.

Hope this helps.

For version 3 and 4 you can try add height: 'parent' to your config.
ref: https://fullcalendar.io/docs/v3/height

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