Bootstrap 带有全高面板的引导程序折叠折叠面板(不带JqueryUI)

kninwzqo  于 2022-12-07  发布在  Bootstrap
关注(0)|答案(1)|浏览(188)

如何使用全高度折叠面板?

像这样的问题:Twitter Bootstrap accordion full height panes但是没有jquery UI而只有引导程序?
我试过这个:http://jsfiddle.net/5xdp9prh/

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

但它不起作用。

vql8enpb

vql8enpb1#

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.

相关问题