Loading Two Image Sizes (Correct Size and Original) on Lazy Load
-
This plugin seems to work the best with srcset, as it actually waits to load image.
But, it does have one catch. It seems to load two images for every image.
It loads the correct sized image placed in the post, but then it also loads the original/full size image. Not sure why. Here is the code before it appears in window:
<img src=”data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7″ data-src=”https://www.traileraddict.com/article/wp-content/uploads/2016/08/cowboys-aliens-2011-1024×576.jpg” alt=”Cowboys & Aliens (2011)” width=”1024″ height=”576″ class=”alignnone size-large wp-image-2191″ data-srcset=”https://www.traileraddict.com/article/wp-content/uploads/2016/08/cowboys-aliens-2011-1024×576.jpg 1024w, https://www.traileraddict.com/article/wp-content/uploads/2016/08/cowboys-aliens-2011-300×169.jpg 300w, https://www.traileraddict.com/article/wp-content/uploads/2016/08/cowboys-aliens-2011-768×432.jpg 768w, https://www.traileraddict.com/article/wp-content/uploads/2016/08/cowboys-aliens-2011.jpg 1440w” sizes=”(max-width: 1024px) 100vw, 1024px”>
This will load
https://www.traileraddict.com/article/wp-content/uploads/2016/08/cowboys-aliens-2011-1024×576.jpg
and
https://www.traileraddict.com/article/wp-content/uploads/2016/08/cowboys-aliens-2011.jpg
When lazy loads.
Can’t figure out why.
Cheers!
Ryan
- The topic ‘Loading Two Image Sizes (Correct Size and Original) on Lazy Load’ is closed to new replies.