When using this script I noticed one disadvantage: When scrolling fast to the bottom of the page one scrolls over the images on the way down and initiates loading. Therefore loading of the final images being in the viewport after scrolling lasts long.
There is an easy fix for this:
//$w.on("scroll.unveil resize.unveil lookup.unveil", unveil); var scrollHandle = null; $w.on("scroll.unveil resize.unveil lookup.unveil", function () { if (scrollHandle) clearTimeout(scrollHandle); scrollHandle = setTimeout(unveil, 200); });
When using this script I noticed one disadvantage: When scrolling fast to the bottom of the page one scrolls over the images on the way down and initiates loading. Therefore loading of the final images being in the viewport after scrolling lasts long. There is an easy fix for this:
//$w.on("scroll.unveil resize.unveil lookup.unveil", unveil); var scrollHandle = null; $w.on("scroll.unveil resize.unveil lookup.unveil", function () { if (scrollHandle) clearTimeout(scrollHandle); scrollHandle = setTimeout(unveil, 200); });