jquery - Bootstrap collapse data-target selector fails -


i have been trying collapse multiple targets on single click. according bootstrap documentation, can achieved specifying matching css selector data-target attribute. however, collapse seems work @ first element matching selector. minimal example here:

<!doctype html>  <html lang="en"> <head>   <meta charset="utf-8">   <script src="https://code.jquery.com/jquery-3.2.1.min.js" integrity="sha256-hwg4gsxgfzhoseeamdoygbf13fyquitwlaqgxvsngt4=" crossorigin="anonymous"></script>   <script src="https://npmcdn.com/tether@1.2.4/dist/js/tether.min.js"></script>   <script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-alpha.6/js/bootstrap.min.js" integrity="sha384-vbwwzlzj8ea9acx4pew3rvhjgjt7zpknpzk+02d9phzyevke+jo0iegizqplforn" crossorigin="anonymous"></script>   <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-alpha.6/css/bootstrap.min.css" integrity="sha384-rwoiresju2yc3z8gv/npezwav56rsmlldc3r/azzgrngxqqknkkofvhfqhnuweyj" crossorigin="anonymous"> </head>  <body>   <div class="device-icon-wrapper" data-toggle ="collapse" data-target=".centrifuge2-collapsible">collapse</div>   <div class="col properties collapse centrifuge2-collapsible">properties</div>   <div class="features centrifuge2-collapsible collapse">features</div> </body> 

if remove or edit class "centrifuge2-collapsible" on first collapsible div, second div become collapsible.

can bootstrap collapse target multiple elements? according this answer, should possible. however, multiple ids failed in case.

why not wrapping items in 1 container...

<!doctype html>      <script src="https://code.jquery.com/jquery-3.2.1.min.js" integrity="sha256-hwg4gsxgfzhoseeamdoygbf13fyquitwlaqgxvsngt4=" crossorigin="anonymous"></script>    <script src="https://npmcdn.com/tether@1.2.4/dist/js/tether.min.js"></script>    <script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-alpha.6/js/bootstrap.min.js" integrity="sha384-vbwwzlzj8ea9acx4pew3rvhjgjt7zpknpzk+02d9phzyevke+jo0iegizqplforn" crossorigin="anonymous"></script>    <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-alpha.6/css/bootstrap.min.css" integrity="sha384-rwoiresju2yc3z8gv/npezwav56rsmlldc3r/azzgrngxqqknkkofvhfqhnuweyj" crossorigin="anonymous">        <div class="device-icon-wrapper" data-toggle ="collapse" data-target=".centrifuge2-collapsible">collapse</div>    <div class="centrifuge2-collapsible collapse">    <div class="col properties">properties</div>    <div class="features">features</div>    </div>


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 -