[How to] Add an Image/Testimonial Carousel in Unbounce Using A Box Widget


Userlevel 6
  • Former Unbouncer
  • 198 replies

Big and bulky image sliders that draw a lot of attention tend to actually hurt conversion rates (Item number 1 in this article) and aren’t something we generally recommend for landing pages.

But that’s not going to dissuade you is it? 😏 We were prepared for that…

Introducing Box Widget Carousels in Unbounce 📈 :spinbounce:

Maybe you want to cycle through some testimonials below the fold to make the page cleaner? Or perhaps you’d like to have a rotating sub headline to free up some space while still saying what you want to?

There are a few small and effective ways to utilize the cycling of elements on a page that come to mind. Please though I beg you, don’t make this the focal point. This is one of those things that would be good to test before adopting. 💯

Below you’ll find some code that will allow you to place items in a box on your Unbounce page and have them automatically cycle with a fade effect, showing one at a time.

You can see this in action (built in Unbounce) here:
http://unbouncepages.com/auto-element-cycle/


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.


Step 1.

Place a box widget on the page, this is going to contain the elements you’d like to cycle through. Make note of the ID of the box, we’ll be using it in the javascript.

Step 2.

Add your content to the box and make sure it is nested (the inside of the box will turn checkered). You can nest images, text, or even other boxes if you’d like to cycle through both images and text together. The script will automatically centre all items in the middle of the box.

Step 3.

Add the jQuery v. 2.2.4 CDN link in the javascript section and set the placement to head.
You can find that here: https://code.jquery.com
Make sure to uncheck the jQuery 1.4.2 box in the javascript section of the page builder

Step 4

Auto Cycle
Add the auto-cycle-elements javascript to your page. Change the ID in the script to match the ID of your containing box. Edit the time to control how long each element is visible for. The default is 2 seconds.
https://gist.github.com/RobertCam/c4742be4edb082b09fc23e98bfa6db1c

On Click
in order to allow the user to control the changing of the elements use this adapted script. Don’t forget to add some buttons to trigger the elements changing and add the IDs of those buttons into the script where indicated.
https://gist.github.com/RobertCam/e50e0223ff348d1db3947b18789caa80

💡 Tip: If you’d like to have multiple boxes cycle elements simply duplicate the script and change the ID for the containing box.

Step 5

Done! Go Celebrate, but keep an eye on that conversion rate!


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


241 replies

Hi, Rob. 

How can I show dot or indicator to the code @Rob ?

I just followed the tutorial video today (03/11/22) and it works just fine. Thank you! 😀

Userlevel 4
Badge

Hey there Raleigh,

Thanks for posting in the Community. Without seeing the page and the carousel setup, it would be difficult to provide an accurate solution. However, it could be that there are multiple jQuery scripts which are conflicting, or possibly some other custom code that is interfering with the carousel JavaScript. Another possibility is that you are using jQuery v. 1.4.2 instead of the most up to date version

Hope this helps to solve the issue.

Hey there,
I have my slides nested and within a container, added both scripts and updated ID for the container, and it still isn’t working. Any ideas?

I had the same issue. I’ve replace the jQuery link in the javascript code. One of then was an older version, so I picked the most recent and replaced so they became equal.

HI! I’m having the same issue. Could you elaborate more on your solution?
Thanks
(I know it has been 4 years but still 🙂 )

I have updated the carousel. The height of the container is adjusted to the tallest slide. But the best thing is that you can make the cards with the Unbounce editor.

Thank you this is great. Usually when I try these things I can’t get them to work, but this was easy to follow.

I’m building a carousel in order to create an animation effect. But for some reason the carousel is working backwards. Can’t for the life of me understand why. I’ve tried moving slides foward and back and the issue continues! Can someone help?

Thank you!!

I made a testimonial slider that works within the Unbounce web editor because my clients found it difficult to edit the testimonials in the code editor block.

I would like to share this with the community, and because I would like to give support and keep improving it, I’m offering it here.

Thanks … @UnbounceTechTeam - do you have any solutions that might be able to help me fix the issue i’m having with my carousel slider slides displaying in completely randomized orders?

Cheers.

Hi! can I do it in multiple sections of a page?

Hey all,

I’ve set up 3 on-click carousels on my page and confirmed with HubSpot that were set up correctly. However, when I look at the live page, the carousel’s appear in completely randomized orders.

By default, it should display the carousel slides in the order in which they are nested. But, they aren’t even sequential in my case.

Anyone have an idea why this might be happening? I’m thinking it may have to do with the fact that I’ve got multiple carousels on the page?

Cheers.

Badge

Is it possible for this script to work for the full width of browser window? I would like my banner hero images to be browser width. Thank you.

Hi Rob, I do everything step by step as per your instructions, and it does not work. Can you help?

Hello All!
I have used this on-click slider for my landing page and it works great on my desktop version.
However on my mobile version I’d like to be able to swipe left/right (with my fingers) instead of having to click on a button to go from one testimonial to the next. This slider doesn’t seem to have that option.

Do you have a solution or code to add here? Or maybe recommend another slider that can do what I need?

Can you help me? Thank you!

Hi @Rob, I tried implementing this on click carousel using a series of videos in each box, but it doesn’t seem to work. Do you have any suggestions for creating a video carousel?

I am seeing this when I implement the carroussel script at the bottom of my landing page… any idea what could cause this? I have implemented the auto script and the on click script on the same page.

Hey! Is there a way to add multiple carousels to a page? particularly auto cycle.

Hi folks, looking for help. My carousel auto-cycle was working past few days. However it stopped cycling today. Can anyone guide me as to what I need to fix? Much appreciated!

Web page: www.jake.sg
Carousel Box ID: lp-pom-box-378

@Rob is there any way to use both the auto and click functions so that if it auto switches to fast a visitor could use buttons to go back to the last box they were looking at?

@Rob Can you give us a script which has buttons for each testimonial, like if there are 10 testimonials so we have 10 small dots below the carousel and if user clicks on any one of them then that testimonial comes up. Example clicking on 6th dot among 10 dots testimonial #6 is shown right away.

Having an issue with the carousel on click. Buttons are there, the labels correct but nothing seems to be happening. Anyone who can help?

thank you so much!

@UnbounceTechTeam Is there a way to make all the images scroll continuously? Not just one after the other

Reply