Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Get calendar elements to calculate their dimensions
- var $trs = $('.fc-minor');
- var $ths = $trs.find('.fc-axis');
- // Width of the entire calendar
- var calendarWidth = $trs.width();
- // Outer width fo the time column
- var timeColumnWidth = $ths.outerWidth(true);
- // Width of each column
- var columnWidth = ( calendarWidth - timeColumnWidth ) / 7;
- $('.fc-event').each(function(index, Event){
- // Change the width and offset so all events overlap nicely
- var eventOffset = parseInt($(Event).css('left'));
- var multiplier = Math.floor(eventOffset/columnWidth);
- var newOffset = ( columnWidth * multiplier) + timeColumnWidth;
- $(Event).width(columnWidth-3);
- $(Event).css({ left: newOffset});
- });
- // Make sure Appointments are a higher z-index
- $('.Appointment').css({'z-index': '9'});
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement