| Issue 1215: | Color the entire day on eventClick | |
| 3 people starred this issue and may be notified of changes. | Back to list |
Hi, I am trying to color the background of a day if an eventClick on this day has occured. Unfortunately, the only options I found were to color the event itself, but not the day. I am looking for a way to get the <td> of a day, when an eventClick has occured. Regards,
Jul 8, 2012
Hi, Thanks for the reply, will implement this in my code ;) Regards.
Aug 14, 2013
(No comment was entered for this change.)
Status:
WontFix
Feb 8, 2014
Hi, Is there a way to deselect the background of the day of the eventClick when selecting another day (both with a different event and without an event)? |
|
| ► Sign in to add a comment |
Hi eventClick: function(calEvent, jsEvent, view) { var mousex = jsEvent.pageX; var mousey = jsEvent.pageY; $('td').each(function(index) { var offset = $(this).offset(); if ((offset.left + $(this).outerWidth()) > mousex && offset.left < mousex && (offset.top + $(this).outerHeight()) > mousey && offset.top < mousey) { if ($(this).hasClass('fc-other-month')){ //Its a day on another month //a high minus number means previous month //a low minus number means next month day = '-' + $(this).find('.fc-day-number').html(); $(this).css('background-color', 'yellow'); } else { //This is a day on the current month day = $(this).find('.fc-day-number').html(); $(this).css('background-color', 'red'); } alert(day); } }); Hope this will solve your problem