The framework lazyloads any <img>,<picture>, or any element with class of lazy and the data-attribute of data-src or data-srcset
<!-- Loads as a background image for ya div boi -->
<div data-src="pichur.jpg" alt="bitch boi"></div>
<!-- Loads img src -->
<img data-src="pichur.jpg" alt="bitch boi" />
<!-- Loads srcset too -->
<img data-src="pichur.jpg" alt="bitch boi" data-srcset="pichur-320w.jpg 320w" />
<!-- Lazyload steroids boi -->
<picture>
<source media="(min-width: 650px)" data-srcset="pichur-650px.jpg" />
<source media="(min-width: 465px)" data-srcset="pichur-465px.jpg" />
<img data-src="pichur.jpg" alt="bitch boi" style="width:auto;" />
</picture>Lazyloading also supports replacement of img tag into the src's svg markup. As long as the image is an svg, it should work. I think.
<img class="lazy" data-src="icoo.svg" alt="bitch boi" />This way you can utilize SVG Classes to :')
To disable lazyload, do this to ya script
(function (fw) {
fw.Settings.modify('lazyLoad', false);
})(fw);Make a new boi by going const lazy = new fw.Lazy(element)
element is the element itself. if blank, defaults to the window.location.hash matching block that has the element class
duh
element is the element triggered. if left blank, this defaults to the element attached to the instance
replaces element with src svg if qualified to do so
element is the element triggered. if left blank, this defaults to the element attached to the instance
adds class to element to sofnigy that yis it loaded the asset
loads all images
before_init_fw_lazy- happens ondocumentbefore running functions to set upinit_fw_lazy- happens ondocumentwhen running functions to set upafter_init_fw_lazy- happens ondocumentafter running functions to set upbefore_svgconversion_fw_lazy- happens onelementbefore loadSVG runssvgconversion_fw_lazy- happens onelementwhen loadSVG runsafter_svgconversion_fw_lazy- happens onelementafter loadSVG runsbefore_load_fw_lazy- happens onelementbefore load runsload_fw_lazy- happens onelementwhen load runsafter_load_fw_lazy- happens onelementafter load runs