me-lazyload
me-lazyload copied to clipboard
Images not loaded even when in view
While scrolling top to bottom, the images do not load unless the entire image is in view port. This is more visible or detectable when you already have a blank image in src tag (when image height is significant). It should start loading that image as soon as the top of the blank images comes in view.
Ok. I have got it working. Need to account for element height in isVisible function.
Change this
else if (elemOffsetY >= winOffsetY) {
if (elemOffsetY <= winOffsetY + viewHeight ) {
yVisible = true;
}
}
to this
else if (elemOffsetY >= winOffsetY) {
if (elemOffsetY <= winOffsetY + viewHeight + elemHeight) {
yVisible = true;
}
}