Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
menu search
person
Welcome To Ask or Share your Answers For Others

Categories

I'm trying to make a nav tabs in bootstrap4 with animation left to right in border bottom it's working good when I'm click on the other words But I faced an issue when I'm click on border-bottom on any other words it's not changing items of tab pane Any Solution for this issue ?

Full Code : link

function activaTab(tab) {
  $('.nav-tabs a[href="#' + tab + '"]').tab('show');
};

activaTab('aaa');

const items = document.querySelectorAll(".nav-tabs li");
items.forEach((item) => {
  item.addEventListener("click", () => {
    document.querySelector("li.active").classList.remove("active");
    item.classList.add("active");
  });
});
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>

<div class="container">
  <ul class="nav nav-tabs">
    <li class="active"><a href="#aaa" data-toggle="tab">Main Skills</a></li>
    <li><a href="#bbb" data-toggle="tab">Experience</a></li>
    <li><a href="#ccc" data-toggle="tab">Education & Certification</a></li>
  </ul>
  <div class="tab-content" id="tabs">
    <div class="tab-pane" id="aaa">
      <p style="font-size: 18px; margin-left:20px; padding-top: 3px; ">User experience design - UI/UX</p>
    </div>
    <div class="tab-pane" id="bbb">
      <p style="font-size: 18px; margin-left:20px; padding-top: 3px;">Front End Designer - RGD Group</p>
      <p style="font-size: 16px; margin-left:20px;">2020 - Current</p>
    </div>
    <div class="tab-pane" id="ccc">
      <p style="font-size: 18px; margin-left:20px; padding-top: 3px; ">Diploma in Civil Enginnering - Florida University</p>
    </div>
  </div>
</div>

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
306 views
Welcome To Ask or Share your Answers For Others

1 Answer

等待大神答复

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
...