How can I hide the blank white screen that appears during loading on my Webflow site and have the images load visibly?

Published on
September 22, 2023

To hide the blank white screen and have the images load visibly on your Webflow site, you can implement a technique called "lazy loading." Lazy loading is a strategy where the images are only loaded when they are needed, instead of all at once when the page is first loaded. This helps reduce the initial loading time and improves the user experience, as the visible content is displayed more quickly.

Here's how you can implement lazy loading on your Webflow site:

  1. Install the Webflow LazyLoad.js script:
  • Go to the Webflow project settings.
  • Click on the "Custom Code" tab.
  • In the "Head Code" section, paste the following code: <script src="https://cdn.jsdelivr.net/npm/@webflow/lazysizes@latest/dist/lazysizes.min.js" async></script>
  • Save the changes.
  1. Add the lazy loading attribute to your image elements:
  • In the Webflow Designer, select an image element on your page.
  • In the right panel, click on the "Settings" tab.
  • Scroll down to the "Attributes" section.
  • Add the attribute "data-src" to the image element. This should contain the URL of the image you want to lazy load.
  • Remove the "src" attribute from the image element.
  • Save the changes.
  1. Publish your site:
  • Click on the "Publish" button in the top-right corner of the Webflow Designer.
  • Wait for the site to publish.
  • Once published, check your site to see if the lazy loading is working correctly.

By implementing lazy loading, you can prevent the blank white screen during loading and improve the user experience by making the images load visibly as they come into view. This optimization technique is especially useful for websites with lots of images or large file sizes.

Additional Information:

  • Lazy loading works on desktop and mobile devices, helping improve performance across different platforms.
  • Make sure to test your site after implementing lazy loading to ensure that all images load correctly and the user experience is not affected.

Example:

<img data-src="your-image.jpg" alt="Your Image">

Questions:

  1. How do I hide the blank white screen during loading on my Webflow site?
  2. What is lazy loading and how can I implement it in Webflow?
  3. Is lazy loading effective on both desktop and mobile devices in Webflow?