Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

disable Bootstrap's Collapse open/close animation [duplicate]

Any trick to disable the open/close animation of Collapse groups ?

like image 361
younes0 Avatar asked Oct 29 '12 10:10

younes0


People also ask

How do I stop a bootstrap collapse?

To control (show/hide) the collapsible content, add the data-toggle="collapse" attribute to an <a> or a <button> element. Then add the data-target="#id" attribute to connect the button with the collapsible content (<div id="demo">).

Which BS 5 attribute and value is used to create a collapse system?

Generally, we recommend using a button with the data-bs-target attribute. While not recommended from a semantic point of view, you can also use a link with the href attribute (and a role="button" ). In both cases, the data-bs-toggle="collapse" is required.

How do I make accordion closed by default bootstrap?

Just add data-toggle="collapse" and a data-target to the element to automatically assign control of one or more collapsible elements. The data-target attribute accepts a CSS selector to apply the collapse to. Be sure to add the class collapse to the collapsible element.

What is data BS toggle in HTML?

data-toggle = “collapse” It is used when you want to hide a section and make it appear only when a div is clicked. Say, the div is a button, so when the button is clicked, the section that you want to collapse appears and re-appears using the button. Example: HTML.


2 Answers

For Bootstrap 3 and 4 it's

.collapsing {     -webkit-transition: none;     transition: none;     display: none; } 
like image 180
Vassilis Avatar answered Sep 23 '22 20:09

Vassilis


Bootstrap 2 CSS solution:

.collapse {  transition: height 0.01s; }   

NB: setting transition: none disables the collapse functionnality.


Bootstrap 4 solution:

.collapsing {   transition: none !important; } 
like image 34
younes0 Avatar answered Sep 22 '22 20:09

younes0