[How-to] Create a Collapsible Page Section

Show first post

105 replies

I know that this script only works for one section per page, but can it be adjusted to work for more sections/boxes? I’d like to create a collapsible FAQ section.

Yes, there is. Just copy the script in another Javascript section. Afterwards you need to replace the variable names for section, box and button -> not only at the top, but also in the whole script!

var toggleSection2 = $(’#lp-pom-block-99’);

var toggleContent2 = $("#lp-pom-box-100");

var toggleButton2 = $("#lp-pom-button-103");

Badge +1

Hey @maxl, would you be able to share what parts need edited if there’s more than one drop down? I can’t seem to get it to work properly.

Userlevel 6
Badge +4

Hi @maxl - what do you mean by “in the whole script”. Where else to change variables?

Hi @maxl, I tried this solution and it worked half ways.
Do I need to change only “toggleSection”, “toggleContent”, “toggleButton” every time they appear or other properties like “sectionHeight”, “toggleContentTop2” …?

Hello. I know its been a while since the code was put here, but I just got around to using it and I have 1 problem. The collapsible part works, but the sections underneath it don’t move accordingly. Instead of a clean section going up and down, I have a big blank space that fills when I click the button. Any ideas where I went wrong?

Thank you!

Hi there, the button will open the panel but does not collapse the panel back down on the mobile version? Is it not supposed to do this on both desktop and mobile?

Is there an unbounce template that has this built in? Tried to figure this out for myself with zero luck.


@Noah @maxl I tried your tipp for more than one collapsible page section but it isn’t working correctly. Do you have an example for your solution?

Hi, i checked out your code for collapsible panels, but did not manage to make it work… : i added the HTML in a html block on the page section and I added the CSS to the CSS, below the page… yet it just shows the text…

Can you advise? Thx

Userlevel 5
Badge +2

Hi @MyWellCare_Deutschla!

Could you send a link to your page? Feel free to send me a private message if you’d like!

Thank you,

Is there any way to launch the collapsible section other than a link?

Ideally, could you launch it when someone scrolls to a certain point on the page?

Just wondering if you ever figured this out? I’m having the same issue.

Exactly what I’m looking for! However, when the sections expand, they are overlapping the text/section below. Is there a fix for this? I hope?! 🙂

Hi Noah,

I was also checking the site out: http://landingpage.noahmatsell.ca/collapsible-section/
and it seems to have the same problem as mine. When you resize the browser the content overlaps at the bottom.

If you see on my web page: http://unbouncepages.com/testing-quote-14/
When I make the browser window as narrow as possible the content overlaps.

Is there any way to fix this?


Userlevel 7
Badge +1

Hi Sam,

In this post @webim shared an excellent workaround for a collapsible page section. It might be worth getting in touch with them to see if you need further assistance. But in the meantime, give this a read and see if it helps. 🙂

Hi @Noah, I am seem to encounter an issue in which the collapsible section, when opened, does not push the fixed section below it further down, but rather overlaps over it. In addition, it causes a footer we use on every page on our domain to go haywire and jump to the middle of the page. Any help would be appreciated!

Anyway I can hide the the button - in this case “Show Speakers” after it has been clicked once?

Hi @Noah I’m having the same issue. The footer (which is the section below our collapsible FAQ section) is not moving, so it’s overlaid on top of the collapsible section. Any workarounds?

Is the written text within the collapsible section crawled by Google?

I did everything and put the JS code - but it’s not working… where can I find more help for how to install a collapsible section in Unbounce ?

this works great on the desktop version, but can’t get it to work on mobile…any ideas what the issue may be?

hi, first, thanks to all for sharing their knowledge. i have a question, which is related to this topic, but in the end i need something, which makes the dynamic Adaptation without a button or similar.

i did embed a .js form, in this case a quiz, works good. meanwhile the process of the process the script box has the same height, but in the last step of the registration it expand downwards and is overlapping some design element. my question is now, when the code box (with the external js) expands, i would like to enjoy, if the rest of the page (the sections below) will automatic move down, so that there is no overlapping anymore. is there a solution?

PS: this script i used on another ub page and work well.

Looking for the same hack. Has anyone gotten to add multiple collapsible sections?

Thanks in advance!

Hola buenas tardes, me gustaria saber como replicar esto y tener varias secciones plegables dentro de mi Landing Page,

les agradeceria mucho su ayuda. 😀