September 27, 2021

Accordian

<div class="container">
        <ul class="accordion">
                <!--Block-->
<li class="accordion block active-block">
<div class="acc-btn active"><div class="icon-outer"><span class="icon icon-plus fa fa-plus"></span> <span class="icon icon-minus fa fa-minus"></span></div>Best Company Ever</div>
<div class="acc-content current">
<div class="content">
    <div class="text">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. </div>
</div>
</div>
</li>
                <!--Block-->
<li class="accordion block ">
<div class="acc-btn "><div class="icon-outer"><span class="icon icon-plus fa fa-plus"></span> <span class="icon icon-minus fa fa-minus"></span></div>Awesome Feature with Great Service</div>
<div class="acc-content ">
<div class="content">
    <div class="text">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. </div>
</div>
</div>
</li>
                <!--Block-->
<li class="accordion block ">
<div class="acc-btn "><div class="icon-outer"><span class="icon icon-plus fa fa-plus"></span> <span class="icon icon-minus fa fa-minus"></span></div>Greate Question for our coustomer</div>
<div class="acc-content ">
<div class="content">
    <div class="text">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. </div>
</div>
</div>
</li>
            </ul>
</div>

 

 <link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css">
    <style>
  .container { max-width:1100px; margin:auto;}
        ul { list-style: none;     margin: 0;
    padding: 0;} 
        .accordion{
  position:relative;
}

.accordion .block{
  position: relative;
    margin-bottom:20px;
}

.accordion .block .acc-btn{
  position:relative;
  font-size:16px;
  cursor:pointer;
  line-height:30px;
  color:#222222;
  font-weight:700;
  border-radius:50px;
  background-color:#f4f4f4;
  padding:10px 45px 10px 40px;
  transition:all 500ms ease;
  -ms-transition:all 500ms ease;
  -o-transition:all 500ms ease;
  -moz-transition:all 500ms ease;
  -webkit-transition:all 500ms ease;
  border:1px solid #cccccc;
}

.accordion .block .acc-btn.active{
  background-color:#fbb908;
  border-color:#fbb908;
}

.accordion .block .icon-outer{
  position:absolute;
  right:15px;
  top:10px;
  font-size:18px;
  color: #242424;
  transition:all 500ms ease;
  -moz-transition:all 500ms ease;
  -webkit-transition:all 500ms ease;
  -ms-transition:all 500ms ease;
  -o-transition:all 500ms ease;
}

.accordion .block .icon-outer .icon{
    position: absolute;
  right:0px;
    width: 28px;
    height: 28px;
    font-size: 16px;
    font-weight: 300;
    text-align: center;
}

.accordion .block .icon-outer .icon-plus{
  opacity:1;
}

.accordion .block .icon-outer .icon-minus{
  opacity:0;
  font-weight:300;
}

.accordion .block .acc-btn.active .icon-outer .icon-minus{
  opacity:1;
  background:none;
}

.accordion .block .acc-btn.active .icon-outer .icon-plus{
  opacity:0;
}

.accordion .block .acc-content{
  position:relative;
  display:none;
}

.accordion .block .acc-content .content-text{
  padding-bottom:6px;
}

.accordion .block .acc-content.current{
  display:block;	
}

.accordion .block .content{
  position:relative;
  font-size:14px;
  padding:20px 20px 10px 20px;
}

.accordion .block .content .text{
  margin-bottom:0px;
  line-height:1.8em;
  font-size:16px;	
  color:#666666;
}

.accordion .block .content p:last-child{
  margin-bottom:0px;	
}


    
    </style>

 

<script src="https://code.jquery.com/jquery-3.4.1.min.js"></script>
  <script>
  $(document).ready(function(){
      if($('.accordion').length){
  $(".accordion").on('click', '.acc-btn', function() {
    
    var outerBox = $(this).parents('.accordion');
    var target = $(this).parents('.accordion');
    
    if($(this).hasClass('active')!==true){
      $(outerBox).find('.accordion .acc-btn').removeClass('active');
    }
    
    if ($(this).next('.acc-content').is(':visible')){
      return false;
    }else{
      $(this).addClass('active');
      $(outerBox).children('.accordion').removeClass('active-block');
      $(outerBox).find('.accordion').children('.acc-content').slideUp(300);
      target.addClass('active-block');
      $(this).next('.acc-content').slideDown(300);	
    }
  });	
}
  })
  </script>

 

Leave a Reply

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