If you found this page on how to create an Elementor Pro preloader through a search engine, you might already know what a preloader is.
However, we will first discuss what a preloader actually means.
As the name suggests, a preloader functions to display a loading image or animation before your website content is fully loaded, which can make a better impression and help introduce your website logo or icon. For example, it looks like this
So, do you understand what it means? If you do, we can proceed to the steps for creating an Elementor Pro preloader.
How to Create an Elementor Pro Preloader
Actually, you can do this with the free version of Elementor, but here we are using Elementor Pro so that we can create a Header element and apply the preloader to all pages on the website.
Additionally, to use this method and perform further customization, you need to understand how to use CSS and Javascript.
Let's get started with the steps to create an Elementor Pro preloader.
1. Create a Header Template
If you do not have a Header template yet, you can create one first. However, if you already have a Header template, you can edit that template.
To create a Header template, you can open the menu Templates > Theme Builder > Header > Click the + icon
2. Add a Container
After you are on the Elementor Header Builder page, you can add your first container. Just choose a single-column container.
After adding the 1-column container, open the Advanced tab and in the Layout > CSS ID section, fill it with wpg_preload
3. Add an Icon/Image Widget
Now, you can add widgets into that container, such as an image, icon, or others. For example, here we are using an icon
Just like when adding a container, in the Edit Icon options, click the Advancedmenu, then add a CSS ID with the name wpg_loader
Finally, open the Style menu and in the Size option, change the size to 1
4. Add an HTML Widget
Now add another HTML widget below the icon or image widget you created previously
Add the following code into the HTML widget
<script> document.addEventListener('DOMContentLoaded', function () { setTimeout(function () { document.getElementById('wpg_preload').style.display = 'none'; document.getElementById('content').classList.add('visible'); }, 2000); });</script>So the result will look like this
Also add a CSS ID with the name wpg_preloader_adds to hide this widget, so that your page does not show any empty space or gaps later
5. Add Custom CSS
The final step you need to take so that the preloader can run is to add custom CSS to the page or Header template. To do this, click the settings icon in the bottom left corner
After you are in the page settings, click or open the Advanced
menu. Add the following code into the available custom CSS
#wpg_preload { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: #fff; /*Warna background penutup konten*/ display: flex; align-items: center; justify-content: center; z-index: 1000;}#wpg_loader { top: 50%; /*Batas atas loader*/ left: 50%; /*Batas kiri loader*/ border: 8px solid #363636; /*Primary loader*/ border-top: 8px solid #3498db; /*Secondary loader*/ border-radius: 50%; width: 50px; height: 50px; animation: spin 1s linear infinite; /*animasi loader*/}@keyframes spin { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); }}#wpg_preloader_adds {display: none;} /*Menyembunyikan widget HTML*/Once you have added the code above, the display in your Elementor will look like this
6. Publish the Page
Since you are finished now, you can publish the page or template you have created, and in the Display Conditionpop-up, you can determine where the preloader will be displayed. For example, here we will display the preloader on all pages on the website
7. Access Your Website Page
Now you can open your website page and try opening various pages according to the conditions you applied in step number 6.
If successful, the result will look like this
How was it, easy right?
Of course, you can perform further customization on the preloader display to make it look more attractive, keeping in mind that the code used in this tutorial is just basic code.
COMMENTS
Loading...