首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >Fullcalendar:为什么日历在页面上出现两次?

Fullcalendar:为什么日历在页面上出现两次?
EN

Stack Overflow用户
提问于 2011-03-11 03:19:07
回答 3查看 4.5K关注 0票数 4

我正在使用jQuery的全日历,由于某种原因,日历在页面上出现了两次。这不是关于在同一页上有两个fullcalendar实例的问题。

相反,在第一个日历的底部,有第二个相同的日历。

我确认我的页面中只有一个#calendar div,所以我相信这个错误与调用fullcalendar.js的.js有关。

任何帮助都非常感谢。

JS代码:

代码语言:javascript
运行
复制
jQuery('#calendar').fullCalendar({


        year: jQuery.today.getFullYear(),
        month: jQuery.today.getMonth(),
        date: jQuery.today.getDate(),
        theme: true,
        contentHeight: 1000,
        header: {
            left: 'prev,next today',
            center: 'title',
            right: 'month,agendaWeek,agendaDay'
        },
        defaultView: 'agendaDay',
        dayClick: function(date, allDay, jsEvent, view) {
                           // a lot of custom code
                    }
            });

HTML:

代码语言:javascript
运行
复制
<table><tr><td valign="top" width="700px"><div id="calendar"></div></td></tr></table>

javascript中fullcalendar的其他调用(这会将一个datepicker放在div中,位于同一页面上#calendar div的左侧):

代码语言:javascript
运行
复制
jQuery('#datepicker_for_calendar').datepicker({
          defaultDate: jQuery.today,
          minDate: jQuery.startDate,
          maxDate: jQuery.endDate,
          inline: true,
          showButtonPanel: true,
          onSelect: function(dateText, inst) {
              var d = new Date(dateText);
              jQuery('#calendar').fullCalendar('gotoDate', d);
              selectedDate = d;
          }
      });
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/5264681

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档