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.

dan1st
  • 12,568
  • 8
  • 34
  • 67
Tobia
  • 9,165
  • 28
  • 114
  • 219

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