JSFiddle - React, Tailwind, and code Playground
HTML
<ul class="accordion-qa-wrapper" id="accordion">
<li class="accordion-qa-wrapper-item">
<span class="item-content triangle">Технический план</span>
<ul class="accordion-qa" style="display: none;">
<li class="accordion-qa-item-header second">
<span class="item-content">
<span class="item-content-inner">
Какие документы мне необходимо предоставить для получения технического плана помещения?
</span>
</span>
<ul class="accordion-qa-child" style="display: none;">
<li class="accordion-qa-child-item">
<div class="accordion-qa-child-content">
<p class="accordion-qa-child-text">
Для того, чтобы мы могли подготовить для вас технический план помещения, в большинстве случаев от вас необходимо получить:
</p>
<ol class="inner-list">
<li class="inner-list-item">поэтажный план этажа, на котором расположено помещение;</li>
<li class="inner-list-item">экспликацию помещения;</li>
<li class="inner-list-item">копию свидетельства о собственности на помещение либо объект, в котором оно расположено.</li>
</ol>
<p class="accordion-qa-child-text">
Также возможна подготовка технического плана на основании разрешения на ввод объекта в эксплуатацию. Хотим отметить, что данный перечень документов не является исчерпывающим и в...
CSS
/*ACCORDION QA START*/
.accordion-qa-wrapper,
.accordion-qa,
.accordion-qa-child,
.inner-list {
position: relative;
margin: 0;
padding: 0;
list-style: none;
cursor: pointer;
}
.accordion-qa-wrapper-item {
margin-bottom: 5px;
font-family: 'Georgia', serif;
font-size: 18px;
color: #bf0000;
}
.accordion-qa-wrapper-item .item-content,
.accordion-qa-wrapper-item .item-content:hover,
.accordion-qa-wrapper-item .item-content:active {
color: #bf0000;
text-decoration: none;
}
.accordion-qa-wrapper-item .item-content,
.item-content-inner {
display: inline;
border-bottom: 1px dashed #bf0000;
}
.triangle {
position: relative;
margin-left: 13px;
}
.triangle:before {
content: '';
position: absolute;
left: -8px;
top: 7px;
height: 1px;
width: 0;
border: solid transparent;
border-left-color: #bf0000;
border-top-color: transparent;
border-width: 4px;
}
.accordion-qa-wrapper-item.active .triangle:before {
left: -10px;
top: 9px;
border-color: rgba(191, 0, 0, 0);
border-top-color: #bf0000;
}
.item-content-inner {
font-size: 16px;
}
.item-content-inner:hover {
color: #9d3d14;
}
.accordion-qa-wrapper .active {
background-image: none !important;
}
.accordion-qa-wrapper-item.active .item-content,
.accordion-qa-item-header.active .item-content .item-content-inner,
.accordion-qa-item-header .item-content {
border-bottom: none;
}
.accordion-qa-item-header .item-content {
position: relative;
display: inline-block;
max-width: 470px;
margin: 5px 0;
padding: 8px 50px 10px 35px;
color: #9d3d14;
font-style: italic;
background-color: #f4ece3;
border-radius: 10px;
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
box-sizing: border-box;
}
.accordion-qa-item-header .item-content:before {
content: '';
position: absolute;
display: inline-block;
left: 8px;
top: 50%;
width: 22px;
height: 41px;
margin-top:...
JavaScript
$('#accordion > li ul')
.click(function(event){
console.log("#1");
event.stopPropagation();
})
.filter(':not()')
.hide();
$("#accordion > li").click(function(e) {
console.log("#2");
e.preventDefault();
$("#accordion > li").removeClass('active');
$(this).addClass('active');
})
$(".accordion-qa-item-header").click(function(e) {
console.log("#3");
e.preventDefault();
$(".accordion-qa-item-header").removeClass('active');
$(this).addClass('active');
})
$('#accordion > li, #accordion > li > ul > li').click(function(){
console.log("#4");
var selfClick = $(this).find('ul:first').is(':visible');
if(!selfClick) {
$(this)
.parent()
.find('> li ul:visible')
.slideToggle();
}
$(this)
.find('ul:first')
.stop(true, true)
.slideToggle();
});