简体   繁体   中英

Increase clickable area of slots behind Fullcalendar event

In week view of Fullcalendar.js, there is a small space to the right of the rightmost event (in each day/overlapping), so that the slots this event occupies may remain clickable. However, the space is pretty small by default. I need to make it bigger.

I inspected every element of the tables that conform a Fullcalendar (currently using version 2.5.0), but I can't seem to find the place where the width of this space is set. I'm beginning to think it's calculated from the events' width, but I'm uncertain.

Is there any way to increase this space in week view?

例

EDIT:

The only provided answer does not work as intended because it adds some space to the right of ALL overlapping events (If two or more events overlap, then the space is added between the overlapping events, and not just to the rightmost event, as desired.)

EDIT: There is now an officially accepted answer that seems to be working.

It is quite old but maybe it helps someone: You can just set the event container margin

.fc-ltr .fc-time-grid .fc-event-container {
    margin: 0 5.0% 0 2px;
}

Try this one

eventAfterRender: function( event, element, view ) { 
    var width = $(element).width();
    width = width - ( width / 3); // Less whatever you want
    // Set the new width
    $(element).css('width', width + 'px');
}

This works for me.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM