JavaScript
4
Вклад в тег
const h1s = document.querySelectorAll("h1");
h1s.forEach( h => h.removeAttribute("style"));
if(fas.classList.contains("fa-plus-circle")){
fas.classList.remove("fa-plus-circle");
}
else{
fas.classList.add("fa-plus-circle");
}
fas.classList.toggle("fa-plus-circle");
var acc = document.getElementsByClassName("event-accordion-item");
var acc = document.querySelectorAll(".event-accordion-item");
acc.forEach( function(acc) {
// Функционал
})
var acc = document.querySelectorAll(".event-accordion-item");
acc.forEach( function(acc) {
acc.addEventListener("click", function() {
this.classList.toggle("active");
var fas = this.querySelector('.eventAccordion-icon');
fas.classList.toggle("fa-plus-circle")
fas.classList.toggle("fa-minus-circle");
var panel = this.nextElementSibling;
if (panel.style.maxHeight){
panel.style.maxHeight = null;
panel.style = 'margin-top: 0px; margin-bottom: 0px';
} else {
panel.style = 'margin-top: 25px; margin-bottom: 25px';
panel.style.maxHeight = panel.scrollHeight + "px";
}
});
});