me-lazyload icon indicating copy to clipboard operation
me-lazyload copied to clipboard

Images not loaded even when in view

Open ketansp opened this issue 9 years ago • 1 comments

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.

ketansp avatar Jan 11 '16 18:01 ketansp

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;
                }
            }

ketansp avatar Jan 11 '16 18:01 ketansp