FullCalendar mini-mode
Make a mini FullCalendar using CSS and an "eventMouseover" callback.
by Mottie
HTML
<link rel="stylesheet" href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8/themes/cupertino/jquery-ui.css">
<script src="https://cdnjs.cloudflare.com/ajax/libs/moment.js/2.10.6/moment.min.js"></script>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/fullcalendar/2.4.0/fullcalendar.min.css">
<script src="https://cdnjs.cloudflare.com/ajax/libs/fullcalendar/2.4.0/fullcalendar.min.js"></script>
<div id='calendar'></div>
CSS
#calendar {
width: 200px;
margin: 0 auto;
font-size: 10px;
}
.fc-toolbar {
font-size: .9em;
}
.fc-toolbar h2 {
font-size: 12px;
white-space: normal !important;
}
/* click +2 more for popup */
.fc-more-cell a {
display: block;
width: 85%;
margin: 1px auto 0 auto;
border-radius: 3px;
background: grey;
color: transparent;
overflow: hidden;
height: 4px;
}
.fc-more-popover {
width: 100px;
}
.fc-view-month .fc-event, .fc-view-agendaWeek .fc-event, .fc-content {
font-size: 0;
overflow: hidden;
height: 2px;
}
.fc-view-agendaWeek .fc-event-vert {
font-size: 0;
overflow: hidden;
width: 2px !important;
}
.fc-agenda-axis {
width: 20px !important;
font-size: .7em;
}
.fc-button-content {
padding: 0;
}
JavaScript
// FullCalendar Latest
// Script modified from the "theme.html" demo file
$(document).ready(function () {
$('#calendar').fullCalendar({
header: {
left: 'prev,next today',
center: 'title',
right: 'month,agendaWeek,agendaDay'
},
defaultDate: '2015-02-12',
eventAfterRender: function () {
// add titles to "+# more links"
$('.fc-more-cell a').each(function () {
this.title = this.textContent;
});
},
// add event name to title attribute on mouseover
eventMouseover: function (event, jsEvent, view) {
if (view.name !== 'agendaDay') {
$(jsEvent.target).attr('title', event.title);
}
},
editable: true,
eventLimit: true, // allow "more" link when too many events
events: [{
title: 'All Day Event',
start: '2015-02-01'
}, {
title: 'Long Event',
start: '2015-02-07',
end: '2015-02-10'
}, {
id: 999,
title: 'Repeating Event',
start: '2015-02-09T16:00:00'
}, {
id: 999,
title: 'Repeating Event',
start: '2015-02-16T16:00:00'
}, {
title: 'Conference',
start: '2015-02-11',
end: '2015-02-13'
}, {
title: 'Meeting',
start: '2015-02-12T10:30:00',
end: '2015-02-12T12:30:00'
}, {
title: 'Lunch',
start: '2015-02-12T12:00:00'
}, {
title: 'Meeting',
start: '2015-02-12T14:30:00'
}, {
title: 'Happy Hour',
start: '2015-02-12T17:30:00'
}, {
title: 'Dinner',
start: '2015-02-12T20:00:00'
}, {
title: 'Birthday Party',
start: '2015-02-13T07:00:00'
}, {
title: 'Click...