Can I specify multiple data targets for Twitter Bootstrap collapse?

前端 未结 7 1389
耶瑟儿~
耶瑟儿~ 2020-12-03 04:26

I\'d like to target two divs for expand when clicking on a single trigger? Is that possible?

7条回答
  •  抹茶落季
    2020-12-03 04:59

    There is a solution in Bootstrap 4:

    Bootstrap 4 documentation: Multiple targets

    The least you need is:

    • data-toggle="collapse" data-target=".multi-collapse" for the toggle button
    • class="collapse multi-collapse" for each element you need to toggle

    (While multiple ids in data-target indeed don't work).

提交回复
热议问题