Advertisement
Guest User

Untitled

a guest
Jul 28th, 2017
64
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. // Get calendar elements to calculate their dimensions
  2. var $trs = $('.fc-minor');
  3. var $ths = $trs.find('.fc-axis');
  4.  
  5. // Width of the entire calendar
  6. var calendarWidth   = $trs.width();
  7.  
  8. // Outer width fo the time column
  9. var timeColumnWidth = $ths.outerWidth(true);
  10.  
  11. // Width of each column
  12. var columnWidth = ( calendarWidth - timeColumnWidth ) / 7;
  13.  
  14. $('.fc-event').each(function(index, Event){
  15.  
  16.     // Change the width and offset so all events overlap nicely
  17.     var eventOffset = parseInt($(Event).css('left'));
  18.     var multiplier  = Math.floor(eventOffset/columnWidth);
  19.     var newOffset   = ( columnWidth * multiplier) + timeColumnWidth;
  20.  
  21.     $(Event).width(columnWidth-3);
  22.     $(Event).css({ left: newOffset});
  23.  
  24. });
  25.  
  26. // Make sure Appointments are a higher z-index
  27. $('.Appointment').css({'z-index': '9'});
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement