[How-to] Create a Collapsible Page Section

Userlevel 7
  • Former Unbouncer
  • 126 replies

Landing pages are designed to provide just enough information to lead your audience to convert. However, there are times when your campaign has a lot of information that you need to include, this can lead to a very cluttered landing page very quickly.

Clutter distracts from conversions, so we’re happy to announce that we’ve cooked up a brand new script to allow you to include all the necessary content in your landing page without looking like a content hoarder!

Introducing: Collapsible Page Sections in Unbounce! :spinbounce:

You can see this in action (built in Unbounce) here:

Now, before you go on a Collapsible Page Section Crusade, we must mention that having too much content on your landing page can be a killer for conversions.

Sure, bells and whistles are fun sometimes, but when you’re trying to lead your viewers to convert - you want to make sure it’s as straight-forward as possible.

This Collapsible Page Section feature should be used responsibly. That being said, this is a very tasteful way to fit in necessary content into your landing pages, enjoy!

How to Install in Unbounce

Click Here for Instructions

This is not an official Unbounce feature. This functionality is based entirely on third party code, and has only been tested in limited applications. Since this isn’t a supported Unbounce feature, our support team will be unable to assist if things go awry. So if you are not comfortable with HTML, Javascript and CSS, please consider consulting an experienced developer.


This script only works for one section per page. Trying to apply this to multiple sections on one page may cause issues.

Grab the latest script here:


Step 1.

Create a new page section and your desired content.

Step 2.

Nest your content inside of a box element (this simplifies things for the script).

Step 3.

Create a button element as your section visibility toggle.

Step 4.

Copy script from collapsible_section.js and paste in your javascripts section

Step 5.

Update your IDs

Step 6.

Save, Preview and celebrate! :parrot:


Like anything else you implement on your page, you’re going to want to test this out thoroughly to see what effect (if any) it has on your conversion rates. We recommend running an A/B test and segmenting a small portion of traffic towards the page - just to be safe.

This how-to was a joint effort with my sister from another mister @Rob!

Can’t see the instructions? Log-in or Join the Community to get access immediately. 🚀

Want to take your Unbounce landing pages + Convertables™ to the next level?
:spinbounce: Check out the Ultimate List of Unbounce Tips, Scripts & Hacks

105 replies

Userlevel 7
Badge +1

@Noah this script is 💣 !!!


Love it! So useful! I know just how I’m gonna use it! 😎

Thanks so much for sharing this! We’ve been looking for an easy workaround like this for a while now!

I’m going to bite here. Viewer discretion advised.

This has to be one of the most lacking inbuilt features for unbounce. It’s the reason I had to buy Thrive Themes and begin systematically transferring my landing pages across.

Collapsible page sections and text should be inbuilt. It’s a feature that should be as simple as placing text into the landing page. Every time I have mentioned this to the unbounce team they redirect me to some bogus study that landing pages convert better without a collapsible FAQ section, which is complete rubbish because the study didn’t take into account if it’s information that’s only relevant to some people. Collapsible sections should be the next inbuilt feature release. Most ppl who use unbounce aren’t developers and they’re definitely not going to pay someone $1000 to implement scripts to make up for these shortfalls/oversights in development. We need intuative features on demand from the right hand editor.

Userlevel 7
Badge +1

Hey @Andi1!

Thanks for biting! I’ll bite back. 🙂

Honestly, the critical feedback is just as, if not more important than all the positive feedback. As much as we’d like to put sticky notes of all the praise we receive on our walls, those won’t help us to build a better product.

In regards to this, sadly, there are only so many things that our team of Product Builders can be responsible for at a time - without compromising the quality of each new feature. We’ve released this workaround in hopes that it will allow users to add Collapsible Page Sections where they’re needed, and buy our Product Builders some time while they work on their current projects.

I won’t hurl statistics at you, as each case is totally unique and sometimes a Collapsible Page Section is a must-have in a landing page (especially FAQ sections).

I totally hear you, and that’s exactly why our Tips & Scripts exist - for both novice and experienced Unbounce users. Plus we have our @Unbounce-Experts who are never afraid to help out some less code-savvy customers.

I’ll be passing this feedback on to our Product team, which may help influence their decisions for which features they’ll be working on in the near future.

Thanks for chiming in here, Andi, keep the feedback coming! ✌️

Yes the community has been great and in combinations with some excellent tutorials I have been able to implement scripts into my landing pages. No complaints there, however like I said other companies seems to be way ahead of the game with much smaller teams and features like these that are built into the content builder. It’s not a whack at unbounce but my time is mich better spent in areas not related to micro focusing my time on scripts. Excuse my ignorance here but if they can be done with scripts they should be easily developed into the builder??

Hey @Andi1! You caught my attention as well, so I’m going to chime in.

You are absolutely correct. In fact, some of our more recent features (lightboxes, video backgrounds) started off as scripts in the Community.

There’s two main reasons that developing Tips & Scripts are important to us:

  1. It solves customer pain-points quickly and easily; and allows us to release new functionality with smaller teams and a minimal investment of time/resources.
  2. It allows us to validate the idea by measuring things like adoption, usage and ease of implementation.

It’s an easy and lightweight way to launch ideas, test iterations and analyze the outcomes. We’re big fans of the Tips & Scripts series here and I’m glad to hear you are, too.

I’ve personally tested out quite a few products similar to Unbounce and I’ll agree that there is usually functionality from one that is missing in the others. We’ve also been around the longest, so I’m confident in saying that we have the most robust and powerful builder on the market.

This brings a few caveats. First, it’s a little bit more difficult for us to jump in with both feet and develop features as quickly as smaller companies can. We have a lot of teams working in sync to solve incredibly complex problems that are a bit bigger in scope than some of the smaller features that we see requests from.

In fact, we’re currently developing really, really exciting products that will blow your socks off once they’re ready - but again, they take a lot of hours, resources and TLC to build. We’ve found a happy medium in developing smaller ideas with things like Tips & Scripts and Ship-it Day… but we can always be better.

As @Jess said though, thank you so much for your feedback. Serioiusly. Feedback is crucial for us to move forward, prioritize and ultimately build better products. We’ll pass this on to our teams internally and they’ll factor it in to the decision making process for our roadmap.

Until then, please feel free to stick around the Community and test out more Tips & Scripts. Feel free to give feedback where you feel it will help, just keep it classy and respectful and we’ll continue to be super receptive and transparent. 🙂

Thanks for the explanation here, it definitely gives me some clarity around the issues I have had with Unbounce over the years. Overall support is great not just in the forums but the live support unbounce provide within the builder. Please don’t remove that and look to increase it in the future as this type of user experience is second to none!

Sticky&scrolling headers, countdown timers, expandable sections and insert favicon are content builder features that I always think, damn these features would be soooo helpful to anyone building out a page. I wonder if I still have to use scripts to implement them? Anyway I can’t wait for these new features!

This is awesome! 🙂 Plus, also really easy to use!

I have tried to use this script for my landing page I have followed the steps, but for some reason, it isn’t collapsing my section. Here is my link http://unbouncepages.com/financialeliteservices/

Userlevel 7

Hey @kiddswoosh, looks like you are missing a toggle button and your IDs in the script need updating (steps 3 + 5). Hope this helps point you in the right direction!

Hey @Noah I’m having issues on mobile and it looks like your demo site is too. Positioning of elements is all over the place. Do you happen to know a fix for this? https://www.dropbox.com/s/zf12wj9kozyt5th/Screenshot%202017-03-09%2017.59.49.png?dl=0

Userlevel 7

Hey @Tim_Corlett, I’ve done some testing and it appears to be working on mobile as expected. Could you direct message me with some browser/device specs to help me try to recreate what you’re seeing?

Hey Jess, Any plans to implement a toggle feature in the tool box? Walls of text are conversion killers and toggle feature is a must have. I run across many cases where I would use this, not just FAQs. Examples: Showing a preview of a review with a “read more” link that expands the rest of the review, product information (ingredients, instructions, ext.), or just on general sections of the page that have in depth information.

I agree with Andi1 on this one - a study that shows landing pages convert better without collapsible FAQ sections is completely useless. Just because it didn’t work for someone, doesn’t mean it won’t work for you. If we just used case studies or best practices as a guide on building landing pages, then what’s the point of A/B testing?

Hi @Noah … I am having trouble making this work on mobile. Desktop works fine… except that the grey bg stops when collapse is open.


button is Testimonials

My mobile version is a completely different bunch of sections. Effectively, I need a another instance of the Javascript … with different IDs for section, box, and button … but this did not work.

What’s the solution?



Hi @Noah …thanks for the code; it works great! I was wondering though if there was a way to have the “toggle button” ONLY reveal the collapsed section and then have another button (like a minus sign) available in that section that would then collapse it?

Hi James,

you mean like having a Hidden Collapsible Page Section triggered by a Button and inside having a Collapsing Divs? Like here shown ?

I just found something about the collapsing Divs HERE, but will be awesome if the Unbounce Experts could explain a little more how to implement it, because only with the CSS code can be harder than normal.

Please PM me, or contact me, or just answer here if this is actually possible: Collapsible Divs inside a Collapsible Page Section. And how to implement them?


Hey Jess!!

Could you please help me little further with the implementation of Collapsible Divs?
Thanx 😃

Hey Noah!
Thanx for this feature. Is super useful.
I still need some help with this awesome code, because isn’t working on my LP.

I put the collapsible section exactly below the Footer, but when the section expands, all the elements (text box, images…) in the footer stay in the same position and overlap the information that’s shown.

Is there something I missed? Or someone knows please how to fix that? Thank you 🙂

Thank you a lot, Noah.
Is there any possibility that I can use multiple collapsible pages on one page using your code?
I desperately need 3 collapsible pages!

Userlevel 7

Sorry @Hani_Chang1 it’s not possible using this code. I’ll let you know if any updates are made down the road.

Hi @Noah, I’m having a similar issue to @ibrudap in that the footer is not correctly re-positioning. When you click to either expand or re-hide the collapsible section, the footer slowly jumps up the page. I’d love any tips into how to fix that. Thanks!

Hi @cbp5032
I actually did with a solution for this. Maybe it could also work for you.
First I had the elements in the Footer inside bigger boxes. And that didn’t allow them to move responsively with the footer.
(For example: A box that had inside 2 Text Boxes and 1 Image)

What I did was putting them outside in individual elements. That fixed the problem in my Landing Page.

Try it as well and let me know 😉 #goodluck

Userlevel 6
Badge +3

Yet another AWESOME script @Noah!!! 🙌🏾