0

How can I use collapse panels with full heights?

enter image description here

Like this question: Twitter Bootstrap accordion full height panes But without jquery UI and only with bootstrap?

I tried this: http://jsfiddle.net/5xdp9prh/

$('#collapseTwo').collapse('show').height('auto');

But it doesn't work.

Community
  • 1
  • 1
Tobia
  • 8,843
  • 26
  • 98
  • 202

1 Answers1

0

I found this quick trick :

.collapse.in{
    height: 100vh;
}

The vh means view height, it also works with vw for for view width if you want an element to be as wide as the window. One unit represents 1/100 of the size of the viewport you are using :)

Here is a working example. https://jsfiddle.net/bebwgwj0/

Moreover this is supported by all modern browsers.

Diane Duquesne
  • 516
  • 2
  • 11