![]() |
I don't like lazy-loading because it looks quite ugly for the user in terms of UX. However, I understand the benefits (faster page load, low bandwidth, high PageSpeed scores etc.)
I am planning to write a javascript code which will:
Stay in the bottom > Wait for the page to fully load > After 3 seconds it will work > Force load all the images which were lazy-loaded previously during initial page load
With this, I won't lose any speed scores (because it will load as normal with lazy loaded images) But, also will load the full images when everything is done, so user won't notice. (we do the same for loading live chat scripts. It works pretty nice)
It will probably look something like this:
I am not a js expert. This was just a dummy example to give an idea. I am specifically asking how to write the content of that "link-to-the-script-to-force-load-images.js" part. Will appreciate any inputs. There was a similar question here, but need an answer for Wordpress: https://stackoverflow.com/questions/30839469/how-to-force-loading-images-for-the-webpages-installed-lazy-load-without-scrol Thanks in advance! Solution - 1so you mean you want to load images after 3 sec. once the page loads completely? Solution - 2From the example you showed it seems like they are loading a placeholder first then after load the actual image url is appended to the image tag https://jsfiddle.net/e2wkp9zh/ I did a quick fiddle on it, check it out, let me know if it works Monit Solution - 3Can you please share your webpage URL? Solution - 4oups... bad answer :) |
Wordpress |
Type: | Code Example |
Category: | Coding |
Sub Category: | Code Example |
Uploaded by: | Admin |
Views: | 21 |