Creating an Elementor Pro Preloader

Creating an Elementor Pro Preloader

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

Cara Membuat Preloader Elementor Pro - 1-1

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.

Cara Membuat Preloader Elementor Pro - 2-1

After adding the 1-column container, open the Advanced tab and in the Layout > CSS ID section, fill it with wpg_preload

Cara Membuat Preloader Elementor Pro - 2-2

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

Cara Membuat Preloader Elementor Pro - 3-1

Just like when adding a container, in the Edit Icon options, click the Advancedmenu, then add a CSS ID with the name wpg_loader

Cara Membuat Preloader Elementor Pro - 3-2

Finally, open the Style menu and in the Size option, change the size to 1

Cara Membuat Preloader Elementor Pro - 3-3

4. Add an HTML Widget

Now add another HTML widget below the icon or image widget you created previously

Cara Membuat Preloader Elementor Pro - 4-1

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

Cara Membuat Preloader Elementor Pro - 4-2

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

Cara Membuat Preloader Elementor Pro - 4-3

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

Cara Membuat Preloader Elementor Pro - 5-1

After you are in the page settings, click or open the Advanced

Cara Membuat Preloader Elementor Pro - 5-2

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

Cara Membuat Preloader Elementor Pro - 5-3

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

Cara Membuat Preloader Elementor Pro - 6-1

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.

Written by

Muhammad Khoirun Nasikin

I enjoy tinkering with WordPress, hosting, VPS, web development, and various small experiments related to websites. I have over 3 years of experience in the web hosting industry.

COMMENTS

Loading...