javascript - Smooth open collapse when adding show class to Bootstrap 4 accordion element -


i have simple task of wanting open collapsed accordion card when adding class via jquery, using collapsed animation. right have code:

$("#collapseone").addclass("show"); 

this works fine opening collapsed element, doesn't play collapsed animation. tried adding .collapsing class well, broke function.

html collapse elements:

<div id="collapseone" class="collapse" role="tabpanel" aria-labelledby="headingone" data-parent="#accordion">                             <div class="card-body">                                 <div id="primarybookmarks" class="list-group">                                     <button type="button" class="list-group-item list-group-item-action">                                                   cras justo odio                                                 </button>                                 </div>                             </div>                         </div> 

i have 2 collapse elements both start off closed. when add element 1 of these, want collapse open.


Comments

Popular posts from this blog

Is there a better way to structure post methods in Class Based Views -

performance - Why is XCHG reg, reg a 3 micro-op instruction on modern Intel architectures? -

jquery - Responsive Navbar with Sub Navbar -