L
L
LastGeneral2021-08-04 18:25:34
WordPress
LastGeneral, 2021-08-04 18:25:34

Why does the code in the short description and the full description of the product work incorrectly?

Faced such a problem, I insert the html code for tabs into a short description of the product and it does not work correctly, when in any other place on the site, then everything works as it should. Already broke my head with what it could be connected

<section class="tabs delivery-tabs__wrap">
    <div class="tabs-link">
        <span class="tab">Доставка</span>
        <span class="tab">Оплата</span>
        <span class="tab">Гарантія</span>
    </div>
    <div class="tab-content">
        <div class="tab-item">
            1
        </div>
        <div class="tab-item">
            2
        </div>
        <div class="tab-item">
            3
        </div>
    </div>
</section>

.best-product {
  padding-top: 3em;
  padding-bottom: 3em;
}
.tabs .tabs-link {
    display: flex;
    justify-content: center;
    margin-bottom: 3em;
}
.tabs .tab {
  text-align: center;
  padding-left: 15px;
  padding-right: 15px;
  width: 200px;
  padding: 10px 0;
  align-items: center;
  font-size: 16px;
  cursor: pointer;
  border-bottom: 1px solid #e8e7e7;
  transition: .2s linear;
}
.tabs .active-tab,
.tabs .tab:hover {
  font-weight: 600;
  border-bottom: 1px solid #e38b22;
}
.tabs .tab-item { 
  display: none; 
}
.tabs .tab-item:first-child { 
  display: block; 
}

jQuery(".tabs-link .tab").click(function() {
  jQuery(".tabs .tab").removeClass("active-tab").eq(jQuery(this).index()).addClass("active-tab");
  jQuery(".tab-item").hide().eq(jQuery(this).index()).fadeIn()
}).eq(0).addClass("active-tab");

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question