Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Hover effect on one cell of agendaWeek + fullcalendar

Hi I am using FullCalendar by Adam Shaw (http://arshaw.com/fullcalendar/). I am using a month and agendaWeek view. I want to put in an hover effect when the user is hovering over a date in month view or a timeslot in agendaWeek view. I tried to change the css as follows:

.fc-widget-content:hover {
        background-color: red;
    }

This works for month view. File attached Hover on 16th Jan

However, the same code selects the whole line in the agendaWeek view when I just need one timeslot to be highlighted.

Example picture below shows the whole 1:00pm slot higlighted for everyday instead of just the timeslot in Wed 02-01 where the mousecursor was.

Hover on whole line instead of one timeslot

Any ideas how to achieve this.

Many thanks.

like image 997
Tripping Avatar asked Jan 02 '13 19:01

Tripping


2 Answers

You're not alone: many users of FullCalendar would like to see highlighting of individual time slots supported out of the box. There's an issue for this on Google Code.

The issue stems from October 2009, so it seems we shouldn't get our hopes up, but several users have suggested different workarounds. One of these is working successfully in my code, so it might be worth to check out.

like image 167
user1332981 Avatar answered Nov 18 '22 21:11

user1332981


this is not something that can be achieved with just css. the issue is that the week grid is being created by superimposing two tables together, both with no background, therefore giving the impression of a grid, but not a true grid. the lengthwise portion of the grid is the higher z-index, so it will always appear on top, and therefore no hover event will ever fire for the height. I played around with ways to trick the user in to seeing the box as highlighted, however, without the ability to know where you are vertically in the grid, it's not really possible. it may be something that could be done with jquery, but i would think the effort involved would not be worth it.

like image 3
mistersender Avatar answered Nov 18 '22 21:11

mistersender