如何自动将FullCalendar适合指定的div空间

kir*_*boy 7 fullcalendar

我想将fullCalendar放入指定的div空间,给它一个流畅的效果但是很难做到.我甚至尝试使用纵横比但没有运气....下面是我到目前为止所做的

    $(window).resize(function() {
    var ratio = $(window).width()/$(window).height();
    $('.resize').html('<div>ratio:'+ratio+'</div>');
    calendar.fullCalendar('option', 'aspectRatio', ratio);
});
Run Code Online (Sandbox Code Playgroud)

Jue*_*ink 10

动态调整高度而不是为我工作的宽高比:

启动时将日历设置为变量:

calendar = $('#calendar').fullCalendar({
    height: $(window).height()*0.83,
    ...
});
Run Code Online (Sandbox Code Playgroud)

然后动态调整高度(在检查已存在日历之后,为了避免初始错误消息):

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

因素*0.83取决于您的页面设计.

希望这可以帮助. 英语,周视 西班牙语,dayview