我正在使用jQuery的全日历,由于某种原因,日历在页面上出现了两次。这不是关于在同一页上有两个fullcalendar实例的问题。
相反,在第一个日历的底部,有第二个相同的日历。
我确认我的页面中只有一个#calendar div,所以我相信这个错误与调用fullcalendar.js的.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>
javascript中fullcalendar的其他调用(这会将一个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;
}
});
https://stackoverflow.com/questions/5264681
复制相似问题