HubSpot Logo Carousel - Loading issue

Hey everyone,

I´d like to know how I can fix the HubSpot Logo Carousel module loading issue. Every time I load the page, the carousel shows all the logos for a few seconds and then they return to their place. Here a picture:

Thanks in advance,

Hi, @NGiacinti7 :waving_hand: Can you share any additional details? Have you edited the code for this module? Hey, @Chris-M @tjoyce @Sjardo, do you have any general troubleshooting tips you can share with @NGiacinti7?

Thank you! — Jaycee

Hey @Jaycee_Lewis , how are you? I published a test web page with this carousel. Actually, the HubSpot module was used as a base to create a new caursel for the hero section, but the error is the same as the HubSpot Logo and others I’ve seen.

HTML section:

<div id="Background_image_corousal_{{name}}">
{% if module.logos|map('background_image')|map('src')|join|length > 0 or module.logos|map('background_color')|length > 0 %} {# << Only create slider if at least 1 image is added #}
 <div id="hs-logo-carousel_{{ name }}" class="hs-logo-carousel">
 {% for slide in module.logos %}
 <div class="hs-logo-carousel__inner">
 <div style="{% if slide.background_image.src %} 
 background: linear-gradient(rgba(0, 0, 0, 0.00), rgba(0, 0, 0, 0.00)), url({{ slide.background_image.src }}) center; -webkit-background-size: cover;-moz-background-size: cover;-o-background-size: cover;background-size: cover; 
 {% else %} 
 background-color: {{ slide.background_color.color }}; opacity: {{ slide.background_color.opacity / 100 }}; -webkit-background-size: cover;-moz-background-size: cover;-o-background-size: cover; background-size: cover;
 {% endif %}">
 <div id="{{name}}_overlayText" style="text-align: left;" class="container">
 <div class="content-desktop hero_SG">
 <div class="title">
 <h2 style="color: {{ slide.title_color.color }}">
 {{ slide.desktop_title }}
 </h2>
 </div>
 <div class="lead">
 <p style="color: {{ slide.subtitle_color.color }}">
 {{ slide.desktop_subtitle }}
 </p>
 </div>

 <div class="cta-sec">
 {% cta guid="{{ slide.add_call_to_action }}" %}
 </div> 
 </div>

 <div class="content-mobile hero_SG">
 <div class="title">
 <h2 style="color: {{ slide.title_color.color }}">
 {{ slide.mobile_title }}
 </h2>
 </div>
 <div class="lead">
 <p style="color: {{ slide.subtitle_color.color }}">
 {{ slide.mobile_subtitle }}
 </p>
 </div>

 <div class="cta-sec">
 {% cta guid="{{ slide.add_call_to_action }}" %}
 </div>
 </div>
 </div> 
 </div>
 </div> 

 {% endfor %}
</div>
{% endif %}
</div>

{% require_js %}
<script>
$(document).ready(function() { 
 if ($.fn.slick) {
 buildSlider_{{ name }}();
 }
 else {
 $.getScript( "https://cdnjs.cloudflare.com/ajax/libs/slick-carousel/1.9.0/slick.min.js", function() {
 $.when($.fn.slick).then(function() {
 buildSlider_{{ name }}();
 });
 });
 }

 function buildSlider_{{ name }}() {
 $('#hs-logo-carousel_{{ name }}').slick({ {# << Slick slider settings go here #}
 dots: false, {# More info: http://kenwheeler.github.io/slick/ #}
 arrows: {{ module.settings.show_arrows }},
 autoplay: {{ module.settings.autoplay }},

 infinite: true,
 speed: {{ module.settings.scroll_speed }},
 slidesToShow: 1,
 slidesToScroll: 1,
 responsive: [{
 breakpoint: 480,
 settings: {
 slidesToShow: 1,
 slidesToScroll: 1
 }
 		}]
 }); 
 }
});

</script>
{% end_require_js %}
{% require_css %}

<style>
 .hs-logo-carousel__inner {
 padding: 0px;
 }

 #Background_image_corousal_{{name}} .hs-logo-carousel {
 margin: 0px !important;;
 }

 #Background_image_corousal_{{name}} .slick-prev {
 left: 15px;
 z-index: 999;
 }

 #Background_image_corousal_{{name}} .slick-prev:before,
 #Background_image_corousal_{{name}} .slick-next:before { 
 color: {{ module.brand_color.color }};
 z-index: 999;
 }

 #Background_image_corousal_{{name}} .slick-next {
 right: 15px;
 }

 body
 {
 margin: 0px !important;
 }
</style>

{% end_require_css %}
{% require_css %}
<style>
 #backimg_{{name}}
 { 
 -webkit-background-size: cover;
 -moz-background-size: cover;
 -o-background-size: cover;
 background-size: cover;
 }

 .content-desktop {display: block;}
 .content-mobile {display: none !important;}

@media screen and (max-width: 768px) {

 .content-desktop {display: none !important;}
 .content-mobile {display: block !important;}
 }

 .container {
 padding-right: 15px;
 padding-left: 15px;
 margin-right: auto;
 margin-left: auto;

 }

 .hero_SG
 {
 padding-top: 5%;
 padding-bottom: 5%;
 padding-left:8%;
 max-width:70%;
 }

 .hero_SG .lead p {
 /*font-family: Lato, sans-serif;*/
 }

 .hero_SG .title h2 {
 font-size: 3.575rem;
 padding-top: 10px;
 font-weight: 500;
 margin-bottom: 0px;
 line-height: 1.1;
 letter-spacing: -.05em;
 }

 .hero_SG .lead p {
 font-weight: 400;
 display: inline-block;
 width: 80%;
 padding-bottom: 5px;
 }

 @media (max-width: 767px)
 { 
 .hero_SG {
 padding-top: 10%;
 padding-bottom: 0%;
 min-height: 300px;
 height: -webkit-fill-available;

 }

 .hero_SG .title h2 {
 font-size: 39.576px;
 font-weight: 400;
 font-style: normal;
 }

 .hero_SG .lead p { 
 width: 100%; 
 }

 }

</style>
{% end_require_css %}

CSS:

.hs-logo-carousel .slick-slide {
 max-width: 100%;
 text-align: left;

}

#Background_image_corousal_module_166263933721386 .slick-prev:before, #Background_image_corousal_module_166263933721386 .slick-next:before {
 color: white!important;
}

/* Slick-theme */

/* Slider */
.slick-loading .slick-list {
 background: #fff url('{{ module_asset_url("ajax-loader.gif") }}') center center no-repeat;
}
/* Icons */
@font-face {
 font-family: 'slick';
 font-weight: normal;
 font-style: normal;
 src: url('{{ module_asset_url("slick.eot") }}');
 src: url('{{ module_asset_url("slick.eot") }}') format('embedded-opentype'), url('{{ module_asset_url("slick.woff") }}') format('woff'), url('{{ module_asset_url("slick.ttf") }}') format('truetype'), url('{{ module_asset_url("slick.svg") }}') format('svg');
}
/* Arrows */
.slick-prev,
.slick-next {
 font-size: 0;
 line-height: 0;
 position: absolute;
 top: 50%;
 display: block;
 width: 20px;
 height: 20px;
 padding: 0;
 -webkit-transform: translate(0, -50%);
 -ms-transform: translate(0, -50%);
 transform: translate(0, -50%);
 cursor: pointer;
 color: transparent;
 border: none;
 outline: none;
 background: transparent;
}
.slick-prev:hover,
.slick-prev:focus,
.slick-next:hover,
.slick-next:focus {
 color: transparent;
 outline: none;
 background: transparent;
}
.slick-prev:hover:before,
.slick-prev:focus:before,
.slick-next:hover:before,
.slick-next:focus:before {
 opacity: 1;
}
.slick-prev.slick-disabled:before,
.slick-next.slick-disabled:before {
 opacity: .25;
}
.slick-prev:before,
.slick-next:before {
 font-family: 'slick';
 font-size: 20px;
 line-height: 1;
 opacity: .75;
 color: black;
 -webkit-font-smoothing: antialiased;
 -moz-osx-font-smoothing: grayscale;
 z-index: 999;
}

[dir='rtl'] .slick-prev {
 right: -25px;
 left: auto;
}
.slick-prev:before {
 content: '←';
}
[dir='rtl'] .slick-prev:before {
 content: '→';
}

.slick-next {
 right: 15px;
}
[dir='rtl'] .slick-next {
 right: auto;
 left: -25px;
}
.slick-next:before {
 content: '→';
}
[dir='rtl'] .slick-next:before {
 content: '←';
}

/* Dots */
.slick-dotted.slick-slider {
 margin-bottom: 30px;
}
.slick-dots {
 position: absolute;
 bottom: -25px;
 display: block;
 width: 100%;
 padding: 0;
 margin: 0;
 list-style: none;
 text-align: center;
}
.slick-dots li {
 position: relative;
 display: inline-block;
 width: 20px;
 height: 20px;
 margin: 0 5px;
 padding: 0;
 cursor: pointer;
}
.slick-dots li button {
 font-size: 0;
 line-height: 0;
 display: block;
 width: 20px;
 height: 20px;
 padding: 5px;
 cursor: pointer;
 color: transparent;
 border: 0;
 outline: none;
 background: transparent;
}
.slick-dots li button:hover,
.slick-dots li button:focus {
 outline: none;
}
.slick-dots li button:hover:before,
.slick-dots li button:focus:before {
 opacity: 1;
}
.slick-dots li button:before {
 font-family: 'slick';
 font-size: 10px;
 line-height: 20px;
 position: absolute;
 top: 0;
 left: 0;
 width: 20px;
 height: 20px;
 content: '•';
 text-align: center;
 opacity: .25;
 color: black;
 -webkit-font-smoothing: antialiased;
 -moz-osx-font-smoothing: grayscale;
}
.slick-dots li.slick-active button:before {
 opacity: .75;
 color: black;
}

Thanks in advance!

Best,