CMS Development

Jlawal
Stratege/Strategin

FAQ module won't open

lösung

Hello,

 

I've put together an FAQ page (can be seen here

 

arrow faq.PNG

Clicking the circled arrow would expand the question and appear like the image below, but this function has stopped working over the past day and i'm not sure why. Any advice on this would be greatly appreciated 🙂 

 

 

faq.PNG

0 Upvotes
1 Akzeptierte Lösung
Lösung
Anonymous
Nicht anwendbar

FAQ module won't open

lösung

Hi @Jlawal,

JavaScript for the accordion is missing.

This is the JS needed for running your accordion. You can place it anywhere in your template and lock the module.

jQuery(document).ready(function(d){
d(".common-section1 .hs_cos_wrapper_widget").first().find(".common-inner h5").addClass("active");
d(".common-section1 .hs_cos_wrapper_widget").first().find(".common-inner h5").next().slideDown(250);
d(".common-inner h5").click(function(){
	d(".common-inner h5").not(d(this)).removeClass("active");
	d(".common-text").not(d(this).next()).slideUp();
	d(this).toggleClass("active");
	d(this).next().slideToggle(250)});
	d(".accordion-section .hs_cos_wrapper_widget").first().find(".faq2-box h5").addClass("active");
	d(".accordion-section .hs_cos_wrapper_widget").first().find(".faq2-box h5").next().slideDown(250);
	d(".faq2-box h5").click(function(){d(".faq2-box h5").not(d(this)).removeClass("active");
		d(".faq2-text").not(d(this).next()).slideUp();
		d(this).toggleClass("active");d(this).next().slideToggle(250)
});
});

This is the JS of the template you purchased :- https://www.revenueriver.co/hs-fs/hub/177047/hub_generated/template_assets/1529919253445/Custom/page...

In case you want other JS of the pages.

Hope it helps! Smiley (überglücklich)

Lösung in ursprünglichem Beitrag anzeigen

5 Antworten
jessebeginbound
Teilnehmer/-in | Platinum Partner
Teilnehmer/-in | Platinum Partner

FAQ module won't open

lösung

Hi, @Jlawal 

If anyone ever runs into this again and gets tired of trying to figure out the code, we made a universal FAQ module that you can find on the HubSpot Marketplace here: https://marketplace.hubspot.com/products/begin-bound/beginbound-ultimate-faq-module-live

 

It has enough style options to match any brand and make it easy for you to add as many FAQ's as you want to any template.

 

Happy HubSpotting!

0 Upvotes
tjoyce
Trendsetter/-in | Elite Partner
Trendsetter/-in | Elite Partner

FAQ module won't open

lösung

@Jlawal - where did you get this module? I don't see any javascript related to the accordion in your source code

0 Upvotes
Jlawal
Stratege/Strategin

FAQ module won't open

lösung

Hi @tjoyce - thanks for your reply.


I took the module from this template.

0 Upvotes
Lösung
Anonymous
Nicht anwendbar

FAQ module won't open

lösung

Hi @Jlawal,

JavaScript for the accordion is missing.

This is the JS needed for running your accordion. You can place it anywhere in your template and lock the module.

jQuery(document).ready(function(d){
d(".common-section1 .hs_cos_wrapper_widget").first().find(".common-inner h5").addClass("active");
d(".common-section1 .hs_cos_wrapper_widget").first().find(".common-inner h5").next().slideDown(250);
d(".common-inner h5").click(function(){
	d(".common-inner h5").not(d(this)).removeClass("active");
	d(".common-text").not(d(this).next()).slideUp();
	d(this).toggleClass("active");
	d(this).next().slideToggle(250)});
	d(".accordion-section .hs_cos_wrapper_widget").first().find(".faq2-box h5").addClass("active");
	d(".accordion-section .hs_cos_wrapper_widget").first().find(".faq2-box h5").next().slideDown(250);
	d(".faq2-box h5").click(function(){d(".faq2-box h5").not(d(this)).removeClass("active");
		d(".faq2-text").not(d(this).next()).slideUp();
		d(this).toggleClass("active");d(this).next().slideToggle(250)
});
});

This is the JS of the template you purchased :- https://www.revenueriver.co/hs-fs/hub/177047/hub_generated/template_assets/1529919253445/Custom/page...

In case you want other JS of the pages.

Hope it helps! Smiley (überglücklich)

Jlawal
Stratege/Strategin

FAQ module won't open

lösung

Hi @Anonymous,

 

That's worked perfectly! Thank you for your help 🙂