Fullcalendar jquery插件高度问题 [英] Fullcalendar jquery plugin height issue

查看:122
本文介绍了Fullcalendar jquery插件高度问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在网页中整合了fullcalendar,但由于某种原因,我通过插件中的'height'属性应用的高度仅适用于MonthView。



  var calendarOptions = {
主题:true,
defaultView:'agendaWeek',
allDaySlot:false,
allDayText:'all-day',
height:($(window).height()) - ($(div.calendarTitle)。offset() ,
firstHour:7,
firstDay:1,
slotMinutes:30,
defaultEventMinutes:120,
axisFormat:'H:mm',
。 ....

基本上,($(window).height( ) - ($(div.calendarTitle)。offset()。top)旨在覆盖给定的区域。

I想知道是否有其他人经历过我或者对我如何克服它有任何想法。我所希望的就是获得相同的高度,无论是月视图,日视图还是周视图。

现在,周和日视图覆盖了页面的70%。

解决方案



  $('#calendar')。fullCalendar('option','height',700); 

FullCalendar Documentation



另一种方法(用于DayView)提供在 这个问题的答案 。 b
$ b

您也可以尝试像 (最后一项)为WeekView。


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.

解决方案

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.

这篇关于Fullcalendar jquery插件高度问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆