Reputation: 3044
How can I disable scrolling in the Agenda View (week, day mode) using the FullCalendar jQuery plug-in? In month mode everything is fine, but when I change to Week/Day mode there is a scrollbar next to my mainpage scrollbar.
Upvotes: 16
Views: 21146
Reputation: 835
Starting from FullCalendar 2.1.0-beta1, you can set { height: 'auto' }
option to disable scrollbars in views.
Although changelog entry for this new functionality can be read as "To turn scrollbars off in month view", it actually works for all views.
In month view, when the calendar's height overflows because of too many events, vertical scrollbars will appear. To turn this behavior off, set the height option to 'auto'. -- from v2.1.0-beta1 changelog
Upvotes: 17
Reputation: 992
Here is an updated and shortened version of @Deulis answer:
$("#calendar").fullCalendar({
viewRender: function(view){
$("#calendar").fullCalendar("option", "contentHeight", (view.name === "month")? NaN : 9999);
}
});
As @Pierre de LESPINAY and @Jens-André Koch already mentioned, viewDisplay is depricated in fullcalendar v2.0. We have to use viewRender instead.
Upvotes: 0
Reputation: 474
This was what I did in my case. The goal is to dynamically change the height, so I used the viewDisplay event in that way:
$('#calendar').fullCalendar({
viewDisplay: function (view) {
var h;
if (view.name == "month") {
h = NaN;
}
else {
h = 2500; // high enough to avoid scrollbars
}
$('#calendar').fullCalendar('option', 'contentHeight', h);
}
});
Upvotes: 20
Reputation: 9449
Sure
$('#calendar').fullCalendar({
height: 999999999
});
If your calendar has a scrollbar when you don't want it to then you have 3 options:
You need to be more specific than "I don't like scroll bars"
Upvotes: 3