• Resolved kreestal

    (@kreestal)


    Hi!

    I use BJ Lazy Load and I activated the Infinite Scroll option. It’s working great.

    However, there still are two problems which I cannot resolve:

    1. When I load some extra pictures with AJAX, I need to scroll the page to see the picture lazy load, even though these pictures are visible in the viewport. I don’t know how to “force” BJ Lazy Load to execute in this case (I was trying something like helgatheviking but it simply won’t work). In this topic, you suggested to manually trigger the scroll after the AJAX load, but I cannot get it to work without forcing the page to scroll… which is very unelegant (it’d look like a bug: why would a page automatically scroll?). I really need the advice of a JavaScript expert here ??
    2. The same problem occurs when I resize the viewport: if some picture wasn’t visible in the viewport 1 (i.e. mobile), and if I resize the viewport so that the picture get visible in viewport 2 (i.e. tablet), then BJ Lazy Load won’t execute: I need to scroll the page again so that it does and loads the visible pictures on screen. Again, it looks quite buggy.

    I tried to fire BJ Lazy Load on resize, but it fails. Any idea please? Many thanks in advance ??

    https://www.ads-software.com/extend/plugins/bj-lazy-load/

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author Bj?rn Johansen

    (@bjornjohansen)

    Again, thanks for the good feedback.

    Issue 1:
    You don’t actually have to scroll, just trigger the scroll event. Like this:
    jQuery(document).trigger("scroll");

    Issue 2:
    I just released version 0.6.7 which should fix this bug.

    Thread Starter kreestal

    (@kreestal)

    Great, thank you! If I trigger the scroll in the AJAX load callback, it works perfectly.

    I was trying to trigger the scroll after the AJAX load function, and not on its complete, which was failing.

    Thank you so much for your help and update ?? Topic resolved, yay!!

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘BJ Lazy Load problem with AJAX and/or viewport resize’ is closed to new replies.