我知道这个问题被问了好几次,我已经搜索了所有问题并遵循了答案,但我不明白为什么我的代码不起作用或哪里出了问题。日历显示事件,但是当我单击事件时,没有看到模式弹出窗口。任何帮助将不胜感激
css && js
bootstrap.min.css
jquery-3.3.1.min.js
bootstrap.min.js
fullcalendar-3.10.0/fullcalendar.css
fullcalendar-3.10.0/lib/jquery-ui.min.js
fullcalendar-3.10.0/lib/jquery.min.js
fullcalendar-3.10.0/lib/moment.min.js
fullcalendar-3.10.0/fullcalendar.js
fullcalendar-3.10.0/gcal.js
Javascript
$(document).ready(function(){
$('#id_btn_showEvents').click(function(){
$('#mcoCalendarForm').submit();
pleaseWait();
});
$('#calendar').fullCalendar({
header: {
left: 'prevYear,prev,next,nextYear today',
center: 'title',
right: 'month,agendaWeek,agendaDay,listWeek'
},
defaultDate: new Date(),
navLinks: true,
editable:false,
eventLimit: true,
eventColor: '#1D5C90',
events: ${eventJson},
dayRender: function(date, cell) {
var today = $.fullCalendar.moment();
var end = $.fullCalendar.moment().add(7, 'days');
$("th.fc-"+date.format('ddd').toLowerCase()).css("background", "#1E5D91");
$("th.fc-"+date.format('ddd').toLowerCase()).css("color", "#f8f9fa");
},
eventClick: function(event, jsEvent, view) {
alert("in event click");
$('#modalTitle').html(calEvent.title);
$('#modalBody').html(calEvent.title);
$('#calendarModal').modal();
}
});
});
<div class='col-md-11'>
<div id='calendar' class='mcoCal' style="padding: 15px;"></div>
</div>
<div id="calendarModal" class="modal fade">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">×</span> <span>close</span></button>
<h4 id="modalTitle" class="modal-title"></h4>
</div>
<div id="modalBody" class="modal-body"> </div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
</div>
</div>
</div>
</div>
经过大量研究,我发现 jquery.min.js 在我的页面中被引用了两次。
删除fullcalendar-3.10.0/lib/jquery.min.js
后,现在显示模式窗口