Online documentation not working
Online documentations isn't working at the moment and will take a while to fix.
Best way to create an accordion dropdown
- _queen_beans
-
Topic Author
- Offline
- New Member
-
Less
More
5 years 1 week ago #80734
by _queen_beans
Best way to create an accordion dropdown was created by _queen_beans
My team would like to implement an accordion dropdown on one of our pages, as it's addresses the problem of seamlessly displaying many categorized ordered lists.
Here's a sample of the desired outcome, implemented in codepen.io
Sample in Codepen.io
I understand there are risks with utilizing js and the admins of this platform are generally not happy when people use them. Mine is vanilla js and not external, however. I'd like to work with the creators of FTH and not get my website frozen/ wiped. Here's a snipped of the code I'd like to use.
Here's a sample of the desired outcome, implemented in codepen.io
Sample in Codepen.io
I understand there are risks with utilizing js and the admins of this platform are generally not happy when people use them. Mine is vanilla js and not external, however. I'd like to work with the creators of FTH and not get my website frozen/ wiped. Here's a snipped of the code I'd like to use.
Code:
var acc = document.getElementsByClassName("accordion");
var i;
for (i = 0; i < acc.length; i++) {
acc[i].addEventListener("click", function() {
this.classList.toggle("active");
this;
var panel = this.nextElementSibling;
if (panel.style.display === "block") {
panel.style.display = "none";
this.style["background-color"] = "#004165";
} else {
panel.style.display = "block";
this.style["background-color"] = "rgb(119, 36, 50)";
}
});
}
The topic has been locked.
5 years 1 week ago #80736
by Brian
Replied by Brian on topic Best way to create an accordion dropdown
FTH does not support any 3rd party scripts. If your script breaks anything we will clear the page.
Please read the Terms of use.
support.toastmastersclubs.org/doc/item/terms-of-use-agreement
Please read the Terms of use.
support.toastmastersclubs.org/doc/item/terms-of-use-agreement
The topic has been locked.
5 years 1 week ago - 5 years 1 week ago #80738
by Pam
FreeToastHost Ambassador
VPE HOT Toastmasters 2025-2026 hot.toastmastersclubs.org/
Webmaster Redlands Toastmasters 2025-2026 redlands.toastmastersclubs.org/
Replied by Pam on topic Best way to create an accordion dropdown
Refer to this post for creating accordions in FTH
support.toastmastersclubs.org/2011-10-23...dion-in-your-content
support.toastmastersclubs.org/2011-10-23...dion-in-your-content
FreeToastHost Ambassador
VPE HOT Toastmasters 2025-2026 hot.toastmastersclubs.org/
Webmaster Redlands Toastmasters 2025-2026 redlands.toastmastersclubs.org/
Last edit: 5 years 1 week ago by Pam.
The topic has been locked.
- _queen_beans
-
Topic Author
- Offline
- New Member
-
5 years 1 week ago #80739
by _queen_beans
Replied by _queen_beans on topic Best way to create an accordion dropdown
The topic has been locked.
- SteveTheTechie
- Offline
- Administrator
-
Less
More
- Posts: 11526
- Thank you received: 3050
5 years 1 week ago - 5 years 1 week ago #80740
by SteveTheTechie
Replied by SteveTheTechie on topic Best way to create an accordion dropdown
So you pulled one of my posts from over 5 years ago...

The fundamental problem is that you may move on from Toastmasters and then your current club is stuck with maintaining whatever you implemented. They will then likely come to us and ask us to help them update your code. We really do not want to be in the position of having to teach people how to do Javascript correctly (not our purpose) or having to fix some problem that somebody else created because they did not heed our warnings. We are volunteers giving up a bit of our little spare time.
In your case, class names "accordion" and "active" will sooner or later end up clashing w/ our code. Only good work around is prefixing them with your club number.


The fundamental problem is that you may move on from Toastmasters and then your current club is stuck with maintaining whatever you implemented. They will then likely come to us and ask us to help them update your code. We really do not want to be in the position of having to teach people how to do Javascript correctly (not our purpose) or having to fix some problem that somebody else created because they did not heed our warnings. We are volunteers giving up a bit of our little spare time.
In your case, class names "accordion" and "active" will sooner or later end up clashing w/ our code. Only good work around is prefixing them with your club number.
Last edit: 5 years 1 week ago by SteveTheTechie.
The topic has been locked.
- _queen_beans
-
Topic Author
- Offline
- New Member
-
5 years 1 week ago - 5 years 1 week ago #80741
by _queen_beans
Replied by _queen_beans on topic Best way to create an accordion dropdown
To be fair, the thread with the official, endorsed accordion solution is also over 5 years old. I'm just working with whatever information I can gather. But I'll stick with the linked solution as I really don't want to pull teeth over this. Thanks for all your help.
Last edit: 5 years 1 week ago by _queen_beans.
The topic has been locked.
Time to create page: 0.105 seconds
Copyright © 2025 FreeToastHost 3 Support. All Rights Reserved.