【发布时间】:2018-02-23 14:49:35
【问题描述】:
为了进一步解释,
我正在使用 FullCalendar 插件 (http://fullcalendar.io/)。每当我将鼠标悬停在一个事件上时,我希望事件信息(标题、日期、时间等)显示在工具提示中。
我有点搞定了,但只显示活动标题。
如何使日期和时间也显示?
提前致谢!
这是我目前得到的:
$(document).ready(function() {
$('#calendar').fullCalendar({
// put your options and callbacks here
height: 'auto',
timeFormat: 'h:mm',
/*eventClick: function(calEvent, jsEvent, view){
window.location = "http://www."
}*/
events: [
{
title : 'Pizza Cooking Class',
start : '2015-11-12T09:00', // Year, Month, Day + Time
color : '#00adef', // Label color
textColor : '#FFF', // Text color
category : '1',
url : 'cookingclass.php'
}
],
eventRender: function eventRender(event, element, view ) {
return ['all', event.category].indexOf($('#category-select').val()) >= 0
},
eventMouseover: function(calEvent, jsEvent, view) {
var tooltip = '<div class="tooltipevent" style="width:200px;height:50px;background:#fff;position:absolute;z-index:10001; padding:20px; border:1px solid rgba(0,0,0,0.1);">' + calEvent.title + '</div>';
$("body").append(tooltip);
$(this).mouseover(function(e) {
$(this).css('z-index', 10000);
$('.tooltipevent').fadeIn('500');
$('.tooltipevent').fadeTo('10', 1.9);
}).mousemove(function(e) {
$('.tooltipevent').css('top', e.pageY + 10);
$('.tooltipevent').css('left', e.pageX + 20);
});
},
eventMouseout: function(calEvent, jsEvent, view) {
$(this).css('z-index', 8);
$('.tooltipevent').remove();
}
});
})
【问题讨论】:
标签: javascript jquery fullcalendar