Avada › Forums › Community Forum › FAQ toggle only for 1 second
-
AuthorPosts
-
after the last update we have the Problem that by toggle down a faq it toogled only for 1 second.
Has anyone a fix or patch or the Same Problem?
exp. https://faq.njf.de/
Does anyone have a fix for this faq toggle issue? I am experiencing the same problem. The FAQ box opens for just a second and then closes again.
Hi @homepeagenjf-de,
Interesting problem. Thanks for sharing your link. Otherwise, I’d never be able to figure this one out.
I have 2 main observations:
1) The HTML for each FAQ content doesn’t seem right to me. Namely the class list. Here’s an example of the first FAQ.
<!-- Conflicting classes: collapse and show. --> <div id="collapse-1-38" class="panel-collapse collapse show" style="">
I’d expect it to have the class
collapse
orshow
not both at the same time. Like this.<!-- Collapsed or hidden content. --> <div id="collapse-1-38" class="panel-collapse collapse" style="">
Or
<!-- Opened or visible content. --> <div id="collapse-1-38" class="panel-collapse show" style="">
2) The event handler for the toggle headings doesn’t seem to be toggling the classes correctly. When I click on the toggle heading I can see a quick message “Collapsing”. But, then the
collapse
class remains and theshow
class toggles fine (removed/added). It’s like the event handler is forgetting to toggle thecollapse
class from the class list. But, this is kinda moot anyway because the class list is already in a conflicting state. It’s like double jeopardy.At any rate, the event handlder code should look something like this.
/* Handle the toggle click event. */ faqElt.classList.toggle("collapse"); faqElt.classList.toggle("show");
I have a minimal reproducible example on CodePen if you’d like to see a live demo of my solution.
You might need to disable your plugins then re-enable 1-by-1 to rule out a plugin conflict. If it’s not a plugin conflict, you might need to escalate the issue.
Thanks!
I have the same issue but only on mobile for this site: https://foreverflowering.com.au – all the FAQ open for a second and close up. Can’t seem to solve it.
I seem to be having the same issue.
I’m not overly experienced with this sort of thing so any help would be greatly appreciated!
Please see link below.
Turns out it was a plugin conflict with the number counter I had!
-
AuthorPosts
- You must be logged in to reply to this topic.