我正在使用Fullcalendar for jQuery,由于某种原因,日历在页面上出现两次。这不是关于在同一页面上有两个fullcalendar实例的问题。Fullcalendar:为什么日历在页面上出现两次?
相反,在第一个日历的底部,有第二个相同的日历。
我确认在我的页面中只有一个#calendar div,所以这个错误与我的.js有关,我调用fullcalendar.js,我相信。
任何帮助非常感谢。
JS代码:
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:
<table><tr><td valign="top" width="700px"><div id="calendar"></div></td></tr></table>
其他fullcalendar的javascript调用(这会一个datepicker在DIV到左同一页上#calendar的div):
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;
}
});
请问您可以发布相关的HTML和JavaScript? – Brandon 2011-03-10 19:20:17
我在fullcalendar调用中有相当多的代码,希望会有一个通用的原因。将尽力减少问题的代码。 – netefficacy 2011-03-10 19:26:18
“相当多的代码”很可能是问题的一部分。另外,你还有其他'fullCalendar'调用(使用字符串参数进行操作)? – justkt 2011-03-10 19:38:56