user2343617
user2343617

Reputation: 11

Fullcalendar dynamic height depending on width

Is it possible to make the value of the 'height' tag the same as the 'width' of the table? The width changes on different screens so I think the height tag should be filled with a piece of jQuery code? I would lik to do this in order to make an exact square (and also all the td's squares).

Thanks.

Jan

Upvotes: 0

Views: 1168

Answers (1)

Mario Levrero
Mario Levrero

Reputation: 3367

You need to set the Aspect Ratio. From doc:

The following example will initialize a calendar who's width is twice its height:

$('#calendar').fullCalendar({
    aspectRatio: 2
});

So, in your case:

$('#calendar').fullCalendar({
    aspectRatio: 1
});

aspectRatio is one of those properties that already have setters, so you can define it after initializing the calendar:

$('#calendar').fullCalendar('option', 'aspectRatio', 1);

Upvotes: 1

Related Questions