如何添加事件到日期在fullcalender上点击日期
答
我发现这个代码在documentation:
$('#calendar').fullCalendar({
dayClick: function(date, jsEvent, view) {
alert('Clicked on: ' + date.format());
alert('Coordinates: ' + jsEvent.pageX + ',' + jsEvent.pageY);
alert('Current view: ' + view.name);
// change the day's background color just for fun
$(this).css('background-color', 'red');
}
});
编辑:的dayClick
是什么,我相信你正在寻找。
+0
这在点击活动时有效。我需要代码添加事件,同时点击特定日期 – sandeep
+0
@sandeep我道歉,我意识到我发布后一分钟左右。我已将我的答案更新为'dayClick'。 – NightOwlPrgmr
答
我发现这个代码在YouTube的Utphala教训:
$(document).on('click','.fc-day',function(){
var date = $(this).attr('data-date');
$.get('index.php?r=events/create',{'date':date},function(data){
$('#modal').modal('show')
.find('#modalContent')
.html(data);
});
});
你能告诉你有什么的问题,到目前为止,任何代码? (使用[编辑]按钮)。 –