jQuery: How do I make an already open accordion slide collapse when I click on a different slide?

Advertisements Working codepen link: https://codepen.io/boingloings33/pen/PoXpLWR I have a mostly functioning accordion that I’m struggling to make auto-collapse an open slide when I click the next one. Any help would be greatly appreciated, thank you. HTML: <body> <div class="container"> <div class="accordion" id="accordion-1"> <div class="head"> <h2>Title 1</h2> </div> <div class="content"> <p> lorem ipsum </p> </div> </div> <br… Read More jQuery: How do I make an already open accordion slide collapse when I click on a different slide?

ReferenceError: handleClick is not defined | Next.js

Advertisements I’m getting a ReferenceError: handleClick is not defined error in my React code, and I’m not sure how to resolve it. Here is the code that’s causing the error: const services = [ { title: ( <AccordionHeader> <AccordionLeft> <span>01</span> </AccordionLeft> <AccordionRight className="icon-container"> <p>Project Name</p> <BsArrowRight onClick={handleClick} className={`icon ${rotate ? "rotate" : ""}`} /> </AccordionRight>… Read More ReferenceError: handleClick is not defined | Next.js

Style header of Bootstrap accordion that has the class "collapse show"

Advertisements I want to style the card header of the panel that has the class collapse show. In the example here it’s the first panel. I tried using CSS by using .accordion .card .card-header button:not(.collapsed) { color: #0c63e4; background-color: #FEB7EE; } However, this doesn’t work unfortunately. Since, all card header are given the style. Is… Read More Style header of Bootstrap accordion that has the class "collapse show"

Accordion is not working when I click the button

Advertisements I’m trying to add the accordion in my page. But when I click the button it’s not toggling. Here is my Html var acc = document.getElementsByClassName(“accordion”); var i; for (i = 0; i < acc.length; i++) { acc[i].addEventListener(“click”, function() { this.classList.toggle(“active”); var panel = this.nextElementSibling; if (panel.style.maxHeight) { panel.style.maxHeight = null; } else {… Read More Accordion is not working when I click the button

Merge two lists, replacing elements with same index in Python

Advertisements I would like to replace elements in one list with elements in another, but only as far as the second list goes. For example: defaults = [‘apple’,’banana’,’cherry’,’date’] data = [‘accordion’,’banjo’] # result: [‘accordion’,’banjo’,’cherry’,’date’] I can do it with a for loop, and I can do it in one line with the following code: result… Read More Merge two lists, replacing elements with same index in Python