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



Show first post

241 replies

someone got any updates? i’m interested as i need it for my delice recipes project. someone can help with some info? i also have some questions. thanks

Also can’t get it to work… Here’s my setup:

url: www.roekoo.nl/o.html
carousel box: lp-pom-box-306 (tried both with and without ‘#’ in front of it in the code)

And the scripts:

Script Name: jQuery
Placement: Head

<script
  src="https://code.jquery.com/jquery-2.2.4.min.js"
  integrity="sha256-BbhdlvQf/xTY9gja0Dq3HiwQF8LaCRTXxZKRutelT44="
  crossorigin="anonymous"></script>

Script Name: Autocycle elements
Placement: after body end tag

<script>
/*
Unbounce Community :: Tips & Scripts :: Carousel With A Box Widget 
TS:0002-04-063
***********************
Do not remove this section. It helps our team track useage of external workarounds.
*/
	
  // jQuery 2.2.4 requierd
  // CDN link here - https://code.jquery.com/
$(function() { 
  // Add a box to the page and nest the elements inside (can include boxes with grouped content)
  // The first element that is nested in the containing box will be what shows on page load

  // Add ID of box containing elements. 
  var container = $("#lp-pom-box-306");

  // Add the amount of time before the element switches. EX: 2000 = 2 seconds
  var time = 2000; 
  
  // code to select and centre elements 
  container.children().css({
                        'top': '50%',
                        'left': '50%',
                        'transform': 'translate(-50%, -50%)'
                           });
  var allEls = container.children().not(":eq(0)");
  var notFirst = allEls.not(":eq(0)");
  notFirst.css('display', 'none');
     
  // Function to cycle through the elements in the containing box and show/hide them  
  function ShowEls(el, delay) {
    $(el[0]).fadeIn(300)
	    .delay(delay)
	    .fadeOut(300)
	    .promise()
	    .done(function() {
	      var putBack = el.splice(0, 1);
	      if (el.length >= 1) {
	        ShowEls(el, delay);
	        allEls.push(putBack[0]);	             
	      }
	    });
    }

  ShowEls(allEls, time); 

});
</script>

Could you help me out @Rob or someone else? really ove to have this feature on our website(s).

Thanks in advance!
Elvin

Userlevel 6

Hi @Ben_Hazan1 Unfortunately I haven’t created a version of the script that combines the auto and click functionality.

In regards to the slide in animation, there is some limited functionality for this included in jQuery, so you could potentially swap out the .fadeOut(500) part of the code with the .slideToggle(500) or .toggle("slide") functions that exist. Unfortunately I don’t think either of these options will be exactly what you’re looking for as they both slide vertically, not horizontally. Jquery doens’t currently have a pre built function for a horizontal slide in, so that would require a custom function which I haven’t created for this workaround. Sorry about that!

Userlevel 6

Could you post a link to the page where the code is implemented? It’s helpful for seeing any errors that might be popping up related to possible syntax. Is the code just not working at all or is there something off with the expected results? One thing you can check is to make sure the content is correctly nested in the box you are targeting with the code. This part can be tedious so I recommend opening up the “content” tab in the bottom left of the builder to make sure everything is nested correctly.

HI @Rob
I’m having an issue with the testimonial carousel. I duplicated another landing page where it works fine, but it doesnt show up at all on this page. https://www.teachzumba.com/zumba1-3/. I changed the script to make sure it is connected to the right pom box, still to no avail. Help please. I’ve tried everything

Hi Rob, my box only shows the first element and then it fades out, and doesn’t show the rest. However, I have 4 boxes with text nested in the original box, and the script is pointing to that original box. How can I fix this?
Thanks in advance!

Hello @Rob, I’m having the same issue as above. We’ve had this code implemented on a few of our pages for over a year and it has always worked. Now it’s showing only the first image and no other images once that fades out. Do you have any ideas what could be causing the issue or a possible solution for it?

Userlevel 6

@teamvoilasocial Could you post a link to the published page with the issue so I can take a closer look and see if there are any errors showing up. One thing to check is to make sure that everything is nested correctly in the builder. This step can be a bit tedious due to how the page builder behaves, so I find opening the “content” tab in the bottom left helps with showing how things are nested. A common issue with the script is the boxes getting nested one level down from the targeted box, which is hard to spot sometimes without that content tab open.

Userlevel 6

Sorry to hear you’re having some issues with the code @JamesN, could you drop a link to one of the pages with the issue here?

Nothing has changed within the script of it’s dependencies that would stop it from working “out of the box”. To confirm that I duplicated the original example page and republished it. The script still works as expected. One thing you could look into would be if any other code has been added to the pages that may be conflicting in some way with this script. So it might be worth checking if anything has been added to the page either via script manager. Code added via Google Tag Manager could also be causing a conflict. I should be able to provide some more help by checking the live page though

@Rob, thank you for the quick reply. It is possible that some new code has been added. We do have a few people that work on pages and they might have added something.
Some example pages are: https://www.abbyy-flexicapture.com/ and https://www.abbyy-flexicapture.com/for-contracts/

This is good info. Thanks

Hey @Rob I’m having some issues getting those left and right buttons to work for me right now. It appears that every time one gets clicked it disappears and the other one reappears (so if I click the left button, the right one shows up!)

Would you have any suggestions?

carousel is at the bottom of the following page which is in progress:
http://unbouncepages.com/cb45fd25-18de-4dde-a246-878c1e9bb17e/

Thanks!

Userlevel 7
Badge +1

Hi Cassandra, I tried taking a look at your link, but it didn’t show up. Did you by chance change the URL?

I’ll keep an eye out 🙂

-Jess

Hey @Rob The on-click function is good, but I need both, auto swap + on click. Any help pls?

Hey @Rob, Thank you for any quick help.

Hey @Rob I’m having some issues on my page too. Would you give it a quick look?

a) Every time I click the left or right button the images get overlapped

b) Can I put instead of a botton with left/right an image?

Would you have any suggestions?

[http://abuelocomodo.com/slider-13/]

Reply