I am using(trying) a lazy loading script called bLazy found here->. The script also supports multiserving of images but I cannot seem to get it to load images if the veiwport is smaller than 1298px [even-though I don't have a call for that size]. This happens in any browser. I also noticed if you drag the window width beyond 1300px after a refresh under 1298px the script fires and the images are downloaded.
From all I can tell on the developers page, this plug works w/o flaw so I am thinking its something on my end.
I am also using JcorsLoader to defer all my scripts in parallel & to initialize everything - and everything I put in it works fine so I doubt it has anything to do with my issue posted here...?
This is how bLazy is loaded and initialized:
JcorsLoader.load(
..., //jQuery loaded here then bLazy
'/assets/js/bLazy.js',
function() {
var bLazy = new Blazy({
breakpoints: [ //--max-width -->
{width: 480, src: 'data-src-small'},
{width: 768, src: 'data-src-medium'},
{width: 1024, src: 'data-src-large'},
]
});
},
... //And other scripts/libraries here
);
The HTML mark up:
. . .
<li>
<img class="b-lazy"
src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw=="
data-src="http://myCDN.com/image/upload/f_auto/v1394566529/IQGIX3.jpg"
data-src-small="http://myCDN.com/image/upload/f_auto/v1394590286/IQGIX3-small.jpg"
data-src-medium="http://myCDN.com/image/upload/f_auto/v1394566529/IQGIX3-medium.jpg"
alt="alt-text" />
<!-- Fallback content for non-JS browsers. -->
<noscript><img src="http:myCDN.com/image/upload/f_auto/v1394566529/IQGIX3.jpg" alt="Alt text"/></noscript>
</li>
. . .
Also note that if I do not use the multi-serve (see below example) feature I get the same results - No image loading if the view port is smaller than 1298px.
JcorsLoader.load(
'/wp-content/themes/WalkingFish/assets/js/bLazy.js',
function() {
var bLazy = new Blazy();
}
);
<li>// Mark up -->
<img class="b-lazy"
src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw=="
data-src="http://myCDN.com/image/upload/f_auto/v1394566529/IQGIX3.jpg"
alt="alt-text" />
<!-- Fallback content for non-JS browsers. -->
<noscript><img src="http://myCDN.com/image/upload/f_auto/v1394566529/IQGIX3.jpg" alt="Alt text"/></noscript>
</li>
The site I am working on is not live but I'll open it up here so you can inspect the use for any flaws. Also take note to the waterfall.
Thnx for your help - I will be greatly appreciated!!
*EDIT * I ended up moving on to another solution that is working with out a hitch. bLazy seems to have a bug where it doesn't function within unordered lists. BttrLazyLoading.js works great - its just twice as heavy.