Dawn Theme – How do I add a FAQ Accordion to Shopify?

$5.00

Category:

Description

Copy & Paste below code with steps or download it:

 

Step-01: Paste below code in the page text editor after creating the page.
<div class=”ramzan-custom-accordion-section”>
  <div class=”Accordions”>
    <div class=”Accordion_item”>
      <div class=”title_tab”>
        <h3 class=”title”>What your store is all about ?<span class=”icon”></span></h3>
      </div>
      <div class=”inner_content”>
        <p>
          “Sed ut perspiciatis unde omnis iste natus error sit voluptatem accusantium doloremque laudantium, totam rem aperiam, eaque ipsa quae ab illo inventore veritatis et quasi architecto beatae vitae dicta sunt explicabo. Nemo enim ipsam voluptatem quia voluptas sit aspernatur aut odit aut fugit, sed quia consequuntur magni dolores eos qui ratione voluptatem sequi nesciunt. Neque porro quisquam est, qui dolorem ipsum quia dolor sit amet, consectetur, adipisci velit, sed quia non numquam eius modi tempora incidunt ut labore et dolore magnam aliquam quaerat voluptatem. Ut enim ad minima veniam.
        </p>
      </div>
    </div>
    <div class=”Accordion_item”>
      <div class=”title_tab”>
        <h3 class=”title”>How to Pay ?<span class=”icon”></span></h3>
      </div>
      <div class=”inner_content”>
        <p>
          Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do
          eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad
          minim veniam, quis nostrud exercitation ullamco laboris nisi ut
          aliquip ex ea commodo consequat.
        </p>
      </div>
    </div>
    <div class=”Accordion_item”>
      <div class=”title_tab”>
        <h3 class=”title”>
          Payment Methods<span class=”icon”></span>
        </h3>
      </div>
      <div class=”inner_content”>
        <p>
          “But I must explain to you how all this mistaken idea of denouncing pleasure and praising pain was born and I will give you a complete account of the system, and expound the actual teachings of the great explorer of the truth, the master-builder of human happiness. No one rejects, dislikes, or avoids pleasure itself, because it is pleasure, but because those who do not know how to pursue pleasure rationally encounter consequences that are extremely painful. Nor again is there anyone who loves or pursues or desires to obtain pain of itself, because it is pain, but because occasionally circumstances occur in which toil and pain can procure him some great pleasure. To take a trivial example.
        </p>
      </div>
    </div>
    <div class=”Accordion_item”>
      <div class=”title_tab”>
        <h3 class=”title”>
          E Commerce Platform<span class=”icon”></span>
        </h3>
      </div>
      <div class=”inner_content”>
        <p>
          “On the other hand, we denounce with righteous indignation and dislike men who are so beguiled and demoralized by the charms of pleasure of the moment, so blinded by desire, that they cannot foresee the pain and trouble that are bound to ensue; and equal blame belongs to those who fail in their duty through weakness of will, which is the same as saying through shrinking from toil and pain. These cases are perfectly simple and easy to distinguish. In a free hour, when our power of choice is untrammelled and when nothing prevents our being able to do what we like best.
        </p>
      </div>
    </div>
    <div class=”Accordion_item”>
      <div class=”title_tab”>
        <h3 class=”title”>
          Sell Online<span class=”icon”></span>
        </h3>
      </div>
      <div class=”inner_content”>
        <p>
          Contrary to popular belief, Lorem Ipsum is not simply random text. It has roots in a piece of classical Latin literature from 45 BC, making it over 2000 years old. Richard McClintock, a Latin professor at Hampden-Sydney College in Virginia, looked up one of the more obscure Latin words, consectetur, from a Lorem Ipsum passage, and going through the cites of the word in classical literature, discovered the undoubtable source. Lorem Ipsum comes from sections 1.10.32 and 1.10.33 of “de Finibus Bonorum et Malorum” (The Extremes of Good and Evil) by Cicero, written in 45 BC.
        </p>
      </div>
    </div>
    <div class=”Accordion_item”>
      <div class=”title_tab”>
        <h3 class=”title”>
          Track Your Order<span class=”icon”></span>
        </h3>
      </div>
      <div class=”inner_content”>
        <p>
          There are many variations of passages of Lorem Ipsum available, but the majority have suffered alteration in some form, by injected humour, or randomised words which don’t look even slightly believable. If you are going to use a passage of Lorem Ipsum, you need to be sure there isn’t anything embarrassing hidden in the middle of text. All the Lorem Ipsum generators on the Internet tend to repeat predefined chunks as necessary, making this the first true generator on the Internet. It uses a dictionary of over 200 Latin words, combined with a handful of model sentence structures, to generate Lorem Ipsum which looks reasonable. The generated Lorem Ipsum is therefore always free from repetition, injected humour, or non-characteristic words etc.
        </p>
      </div>
    </div>
    <div class=”Accordion_item”>
      <div class=”title_tab”>
        <h3 class=”title”>
          Buying Guide<span class=”icon”></span>
        </h3>
      </div>
      <div class=”inner_content”>
        <p>
          It is a long established fact that a reader will be distracted by the readable content of a page when looking at its layout. The point of using Lorem Ipsum is that it has a more-or-less normal distribution of letters, as opposed to using ‘Content here, content here’, making it look like readable English. Many desktop publishing packages and web page editors now use Lorem Ipsum as their default model text, and a search for ‘lorem ipsum’ will uncover many web sites still in their infancy. Various versions have evolved over the years, sometimes by accident, sometimes on purpose (injected humour and the like).
        </p>
      </div>
    </div>
  </div>
</div>
Step-02: Paste below code in theme.liquid file just above </head>.
<!–   Ramzan custom CSS :: Starts –>
<style>
  .ramzan-custom-accordion-section section {
    max-width: 800px;
    margin: auto;
    text-align: center;
    padding: 80px 0;
    border-bottom: 1px solid #4a4a4a;
  }
  .ramzan-custom-accordion-section section h1 {
    font-size: 36px;
    text-transform: uppercase;
    padding: 0 12px;
  }
  .ramzan-custom-accordion-section section p {
    font-size: 16px;
    text-transform: capitalize;
    padding: 10px 12px;
  }
  .ramzan-custom-accordion-section .container {
    width: 100%;
  }
  .ramzan-custom-accordion-section .Accordions {
    display: block;
    margin: auto;
  }
  .ramzan-custom-accordion-section .Accordion_item {
    width: 100%;
    height: auto;
    margin: 5px 0;
  }
  .ramzan-custom-accordion-section .Accordion_item:first-child {
    margin-top: 50px;
  }
  .ramzan-custom-accordion-section .Accordion_item .title_tab {
    width: 100%;
    background-color: #dfdfdf;
    color: #fcfcfc;
    padding: 12px 30px;
    cursor: pointer;
    transition: background-color 0.3s ease-in;
    border-radius: 2px;
  }
  .ramzan-custom-accordion-section .Accordion_item .title_tab .title {
    color: #666666;
    font-size: 19px;
    font-weight: 600;
    position: relative;
    font-family: Karla, sans-serif;
    margin: 0px;
  }
  .ramzan-custom-accordion-section .Accordion_item .title_tab .title .icon {
    position: absolute;
    right: 1%;
    top: calc(50% – 8px);
    width: 6px;
    height: 16px;
    background-color: transparent;
    transform: rotate(-90deg);
    transition: transform 0.3s ease-in;
  }
  .ramzan-custom-accordion-section .Accordion_item .title_tab .title .icon:before,
  .ramzan-custom-accordion-section .Accordion_item .title_tab .title .icon:after {
    content: “”;
    position: absolute;
    height: 100%;
    width: 2px;
  }
  .ramzan-custom-accordion-section .Accordion_item .title_tab .title .icon:before {
    top: 0;
    left: 2px;
    transform: rotate(270deg);
    background-color: black;
  }
  .ramzan-custom-accordion-section .Accordion_item .title_tab .title .icon:after {
    top: 0;
    right: 2px;
    transform: rotate(180deg);
    background-color: black;
  }
  .ramzan-custom-accordion-section
    .Accordion_item
    .title_tab.active
    .title
    .icon:before {
    background-color: white;
  }
  .ramzan-custom-accordion-section
    .Accordion_item
    .title_tab.active
    .title
    .icon:after {
    background-color: unset;
  }
  .ramzan-custom-accordion-section .inner_content {
    width: 100%;
    height: auto;
    display: none;
    overflow: hidden;
    padding-top: 10px;
    padding-bottom: 10px;
  }
  .custom-accordion-section .inner_content p {
    font-family: Karla, sans-serif;
    color: #666666;
    background: white;
    width: 98%;
    margin: auto;
    padding: 18px 15px;
    font-size: 16px;
    line-height: 28px;
    opacity: 0;
    transform: translate3d(0px, 60px, 0px);
    transition: transform 0.6s cubic-bezier(0, 0.99, 0.44, 1.01),
      opacity 0.8s 0.1s cubic-bezier(0, 0.99, 0.44, 1.01);
  }
  .ramzan-custom-accordion-section .Accordion_item .title_tab.active,
  .ramzan-custom-accordion-section .Accordion_item .title_tab.active:hover {
    background-color:  #FF6F61;
    color: white;
    transition: background-color 0.3s ease-in;
  }
  .ramzan-custom-accordion-section .Accordion_item .title_tab.active .title {
    color: white;
  }
  .ramzan-custom-accordion-section .Accordion_item .title_tab.active .title .icon {
    transform: rotate(0deg);
    transition: transform 0.3s ease-in;
  }
  .ramzan-custom-accordion-section .Accordion_item .title_tab:hover {
    background-color: #f7f7f7;
    color: black;
    transition: background-color 0.3s ease-in;
  }
  .ramzan-custom-accordion-section .Accordion_item .inner_content p {
    padding-left: 30px;
    padding-right: 30px;
    font-size: 18px;
    color: black;
  }
  .ramzan-custom-accordion-section .Accordion_item .inner_content p.show {
    opacity: 1;
    transform: translate3d(0px, 0px, 0px);
    transition: opacity 0.8s cubic-bezier(0, 0.99, 0.44, 1.01),
      transform 0.6s 0.1s cubic-bezier(0, 0.99, 0.44, 1.01);
  }
  .ramzan-custom-accordion-section .inner_content p span {
    font-size: 14px;
    line-height: 30px;
  }
  .ramzan-custom-accordion-section .inner_content p b {
    color: #f44336;
    font-size: 18px;
  }
</style>
Step-03: Paste below code in theme.liquid file just above </head>.
<script src=”https://ajax.googleapis.com/ajax/libs/jquery/3.6.0/jquery.min.js”></script>
Step-04: Paste below code in theme.liquid file just above </head>.
<script>
  $(document).ready(function () {
    var $titleTab = $(“.title_tab”);
    $titleTab.on(“click”, function (e) {
      e.preventDefault();
      if ($(this).hasClass(“active”)) {
        $(this).removeClass(“active”);
        $(this).next().stop().slideUp(500);
        $(this).next().find(“p”).removeClass(“show”);
      } else {
        $(this).addClass(“active”);
        $(this).next().stop().slideDown(500);
        $(this)
          .parent()
          .siblings()
          .children(“.title_tab”)
          .removeClass(“active”);
        $(this).parent().siblings().children(“.inner_content”).slideUp(500);
        $(this)
          .parent()
          .siblings()
          .children(“.inner_content”)
          .find(“p”)
          .removeClass(“show”);
        $(this).next().find(“p”).addClass(“show”);
      }
    });
  });
</script>
<!–   Ramzan custom JS :: Starts –>

Reviews

There are no reviews yet.

Be the first to review “Dawn Theme – How do I add a FAQ Accordion to Shopify?”

Your email address will not be published. Required fields are marked *