• Resolved Darko A7

    (@darko-a7)


    Hi there, thanks for the great plugin!

    I am using it for years, had few minor issues in the past and all was resolved. However, one problem which I have from the day 0, but never bothered with it much, is the fact that on first page load, ALM always automatically triggers the first cycle.

    Let me put this into the context: my theme is noscript compatible, this means that it looks & works almost the same w/wo js enabled. Great! Next, I have a simple loop that prints N posts (as per standard post/per/page setting) and all’s fine. After the standard loop — there comes the ALM shortcode thing, and that works fine w/o any issues.

    However, for some reason, ALM is always executing first cycle on the initial page load, regardless of the fact that user has not even started scrolling down yet. So, instead of 3 init posts, I get 3+3=6, and so on – you get the idea.

    That was not big of a deal before, but since I am working on some new features in my theme, this is becoming a huge issue, not just a simple side-effect and annoyance. Problem is definitely js/jquery related, as with js disabled, ALM does not fire (so, php side and shortcode are not part of the problem).

    My theme does not have any other ajax functionality that could mess around with it, so… I’m pretty sure it’s the intended behavior. And, before posting this issue here, I have switched to a stock 2017 theme for a quick test, and the problem is definitely in the ALM implementation, as it was the same.

    So, the only way to solve this is to implement ALM-only code, instead of the loop.

    But, this can be solved by adding an option and modifying jquery code to trigger ALM loading only when the button is (for example) in viewport/visible, and user is scrolling down.

    Thank you for considering this!
    Regards

    • This topic was modified 6 years, 9 months ago by Darko A7.
    • This topic was modified 6 years, 9 months ago by Darko A7.
Viewing 1 replies (of 1 total)
  • Thread Starter Darko A7

    (@darko-a7)

    I have managed to solve this issue with following options in shortcode builder:

    pause="true" pause_override="true" scroll="true"

    Marking this issue as resolved.
    Thanks!

Viewing 1 replies (of 1 total)
  • The topic ‘Trigger ajax loading only if ‘alm-load-more-btn’ is visible & scrolling down’ is closed to new replies.