Created an accordion using the code posted on the Readymag website. Everything worked. Added another, on the same page, and it no longer works. Is it possible to have 2 accordions on one page? Maybe something needs to change in the code?
Hi @annakreshchenko welcome to the ReadyMag forum. Have you tried turning on this button, otherwise it will probably conflict due to it sharing same HTML ID and Class names.
if the trick from @HEADLESS.HORSE isnt doing it. you could manually change the classnames/variabled in the accordeon code and evade the naming conflict, which errors the execution of the code.
Thank you very much for the answer!
Thanks it helped, have a nice day
Hi @neueMeta & @HEADLESS.HORSE! I changed the classnames, which allowed me to have two accordions on one page, but now the first accordion wonât âclose.â Once the panel is opened, it stays open. Any tips on how to adjust the script? Much appreciated!
Hi @designbyellie is it possible to paste the code in the forum here? We can then review it for you.
@HEADLESS.HORSE thanks for the quick reply! I used your accordion code from the Readymag article but for the second accordion, I changed all instances of the word âaccordionâ to âdropdown.â This allowed me to have two accordions on one page. However, the first accordion (using the exact code you created with no changes) no longer âhidesâ the panels after theyâve been opened. Oddly, the second accordion with the âdropdownâ code opens & closes just fine. Iâm assuming this has something to do with the script at the end having the same commands for both accordions. Hope that clarifies things. I can paste the code here, but it is exactly as written in the Readymag article! Appreciate your help.
I have you tried turning one âuse iFrameâ as per the previous reply?
I did & it does work, but I donât love seeing the scroll bar on the accordion. Is there a way to hide that?
Thatâs great to hear. To your CSS add the following.
html {
-ms-overflow-style: none;
scrollbar-width: none;
}
::-webkit-scrollbar {
display: none;
}
Hmm unfortunately that didnât work! Scroll bar still shows.
Hi. Did you find a solution to the problem?
@HEADLESS.HORSE I am also having a similar issue, I have accordions on multiple pages, but when I click on a link to a page the accordion on the destination page wonât open. But then when I refresh it works. Any ideas? It works fine when i use iFrame, but then I seem to lose ability to change font etc.