J
J
Jesus_newrba2019-06-17 07:04:32
css
Jesus_newrba, 2019-06-17 07:04:32

How to change card background from bootsrap on collapse?

There is a slightly modified card from bootsrap with collapse from the documentation

<div class="card card-cst">
                <div class="card-header" id="headingTwo" data-toggle="collapse" data-target="#collapseTwo" aria-expanded="false" aria-controls="collapseTwo">
                  <span>Свидетельства</span>
                </div>
                <div id="collapseTwo" class="collapse" aria-labelledby="headingTwo" data-parent="#accordionExample">
                  <div class="card-body">
                    Anim pariatur cliche reprehenderit, enim eiusmod high life accusamus terry richardson ad squid. 3 wolf moon officia aute, non cupidatat skateboard dolor brunch. Food truck quinoa nesciunt laborum eiusmod. Brunch 3 wolf moon tempor, sunt aliqua put a bird on it squid single-origin coffee nulla assumenda shoreditch et. Nihil anim keffiyeh helvetica, craft beer labore wes anderson cred nesciunt sapiente ea proident. Ad vegan excepteur butcher vice lomo. Leggings occaecat craft beer farm-to-table, raw denim aesthetic synth nesciunt you probably haven't heard of them accusamus labore sustainable VHS.
                  </div>
                </div>
              </div>

.card-cst .card-header {
  padding: .532rem 0.75rem;
  background-color: #fcfcfc;
  background-image: url(img/menu-down.svg);
  background-repeat: no-repeat;
  background-position: 99% 7px;
}

How to implement background-image change when opening collapse?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
I
iBird Rose, 2019-06-17
@iiiBird

Use "show.bs.collapse" and "hide.bs.collapse" events to add classes on parent or .card-header
https://getbootstrap.com/docs/4.3/components/colla...
more on them already style.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question