我想在年视图中为全日历添加工具提示。我尝试使用下面的方法,但是它在月视图中添加了工具提示。我尝试了与谷歌,但没有找到与此有关的任何东西。还有其他方法可以在年视图中添加工具提示吗?
eventMouseover: function(calEvent,jsEvent) {
xOffset = 10;
yOffset = 30;
$("body").append(calEvent.tooltip);
$("#tooltip")
.css("top",(jsEvent.clientY - xOffset) + "px")
.css("left",(jsEvent.clientX + yOffset) + "px")
.fadeIn("fast");
},
eventMouseout: function(calEvent,jsEvent) {
$("#tooltip").remove();
}
最佳答案
eventMouseover: function(calEvent, jsEvent) {
var tooltip = '<div class="tooltipevent" style="width:100px;height:100px;background:#ccc;position:absolute;z-index:10001;">' + calEvent.title + '</div>';
var $tooltip = $(tooltip).appendTo('body');
$(this).mouseover(function(e) {
$(this).css('z-index', 10000);
$tooltip.fadeIn('500');
$tooltip.fadeTo('10', 1.9);
}).mousemove(function(e) {
$tooltip.css('top', e.pageY + 10);
$tooltip.css('left', e.pageX + 20);
});
},
eventMouseout: function(calEvent, jsEvent) {
$(this).css('z-index', 8);
$('.tooltipevent').remove();
},