There is a standard layout example, it works and when you press the button, it collapses or expands the div c id="demo"

 <button type="button" class="btn btn-danger" data-toggle="collapse" data-target="#demo"> simple collapsible </button> <div id="demo" class="collapse in"> … </div> 

Is it possible to automatically minimize the element with id="demo" for the mobile version using standard Bootstrap tools?

  • .hidden-xs can help? if it does not block the toggle. - Artem Gorlachev
  • @ArtemGorlachev Re-read the question and try to rethink the answer and the question ... - Dmitry Nail

1 answer 1

The default in inception collapse is the in class.
Solution: remove the in class from the #demo layout and add it to js at a certain screen resolution.

Standard tools bootstrap (methods or events) for such actions are not found.
getbootstrap.com/javascript/#collapse