Share on

Table of Contents

profile-pic (1)
Mansoor Ahmad
November 26, 2024

How To Sync Background Slideshow with Loop Carousel Widget

There is always a time when you see a section on a website and you want to replicate it in your WordPress website. It’s that time but we will do with the help of custom code.

In this article, I’ll show you how you can synchronize a background slideshow with an Elementor Loop Carousel Widget inside it. So if you click to navigate any loop carousel item, the background slideshow is also going to change with it. This is going to be done with the help of custom JavaScript code.

Before You Begin:

  1. You will need to have Elementor Pro installed as this tutorial is based on the Pro widget which is the Loop Carousel Widget.
  2. You will be adding custom JavaScript code into your website via the Elementor Custom Code feature.
  3. You will need to build everything into one container so that includes the slideshow and the loop carousel widget.

So now, let’s get started and Sync our slideshow with Loop Carousel Widget.

Build Your Section

In order for the whole synchronization of slideshow with the loop carousel widget to work you need to build your container that has the following:

  1. A background slideshow.
  2. Content in the container.
  3. A Loop Carousel Widget with 1 slide display only.

You will need to have your section as below:

Now, you will need to add background slideshow to your primary container or the biggest section which will contain all content as shown below:

After adding a background slideshow, you can add your further content and then add your Loop Carousel Widget having exact same number of items as the number of slides.

I have added 3 slides to background, so I am having 3 loop carousel items as well as shown below:

Adding CSS IDs

We need to add CSS IDs that is going to help the JavaScript code identify the elements on the page and act so the synchronization works properly fine.

There are two CSS IDs you need to add:

  1. outer-slider-box This CSS ID is going to be added to the primary container/section of the page which has the content.
  2. inner-slider-box This CSS ID will be given to the exact Loop Carousel Widget itself.
  3. Now you have added CSS IDs to both your primary container and the loop carousel widget itself.

Adding The Custom JavaScript Code:

In order to add your custom JavaScript into your website, you can either add it directly via HTML widget but that becomes a little bit messy. You can follow the steps below to add it via Custom Code feature:

  1. Go to Dashboard.
  2. Hover on Elementor and click on “Custom Code” as shown below:
  3. Click on “New Code”
  4. Add the following given code to the page.
  5. Set the location to </body> – End as shown below:
  6. Click on Publish.

Here is the code you need to add:

				
					
				
			

After adding the code, save everything and you can view the page on the front-end.

You will see that if you click on the navigation dots of the Loop Carousel Widget, the background slides are going to change along with them.

Mansoor Ahmad

Mansoor Ahmad is a web developer and WordPress enthusiast. He has been building websites with WordPress since 2013. He is passionate about teaching and writing about WordPress and helping fellow web creators build better websites.

How To Fix The “503 Service Temporarily Unavailable” Error In WordPress?

WordPress is the most popular content management system available in the market. It is simple to use, beginner-friendly and offers a whole host of features that allows any person to

Four WooCommerce Recommended Hosting Solutions for Beginners

WooCommerce is one ecommerce platform that allows anyone to create their own store within minutes. It is fast to set up, easy to use and provides a lot of flexibility

Four Ways to Redirect www to Non-www of WordPress Website

People rarely use the ‘www’ standard for writing URLs today. Instead, they prefer to write the URL’s name and its domain type in search engines and press enter.  Google treats