Can someone help me and figure out where the problem is?
You are using Fullcalendar v3, which is quite outdated - and had a significantly different API.
In v3, the event is named eventMouseover
, see https://fullcalendar.io/docs/v3/event-clicking-hovering, and it passes different parameters to the callback function as well.
https://fullcalendar.io/docs/v3/eventMouseover:
Within the callback function,
this
is set to the event’s<div>
element.
So what you need here, with v3 of Fullcalendar, is simply this:
eventMouseover: function() {
this.style.backgroundColor = "red";
}
And the counterpart for eventMouseLeave
back in v3 was eventMouseout
.
(Notice that I modified the way the background color is manipulated a tiny bit here as well. Directly accessing the property you want to manipulate, is a bit "safer", than assigning a new value to the whole style
object, which can have other side effects. And even better would be not to use inline styles in the first place - but add/remove a class on the element, and then let the desired formatting apply via a corresponding rule in your stylesheet.)