I'm using FullCalendar and I'm attempting to make it responsive by changing the view when the window size is below a certain size:
windowResize : function(view) {
if ($(window).width() < 500) {
$('#calendar').fullCalendar('changeView', 'basicDay');
} else {
$('#calendar').fullCalendar('changeView', 'month');
}
// modify the header (remove options for month and week and remove title)
}
That works fine but how can I modify the header (remove options for month and week and remove title)? You can see an example of the calendar here.
Header is set as such:
$('#calendar').fullCalendar({
header : {
left : 'prev,next today',
center : 'title',
right : 'month,basicWeek,basicDay'
}
});
I needed a responsive script too, but the best i get was:
var view = 'month';
var header = {
left : "title",
center : "",
right : "prev,next month,basicWeek,basicDay today"
};
if ($(window).width() <= 480) {
view = 'basicDay';
header = {
left : 'prev,next today',
center : '',
right : ''
};
}
var acalendar = $("#ccalendar").fullCalendar(
{
lang : "pt-BR",
defaultView : view,
header : header
}
Maybe you can rebuild de calendar on resize.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With