Provide scroll loading by ajax

Created on 17 December 2022, almost 2 years ago
Updated 23 May 2024, 6 months ago

Problem/Motivation

When i enable "load more" module works fine.
But may be useful to load items with scroll.

Proposed resolution

Add scroll loading functionality and add checkbox to select which type of loading use.
Like Views Infinite Scroll module for views

thank you

Feature request
Status

Active

Version

2.0

Component

Code

Created by

🇮🇹Italy trickfun

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • 🇮🇳India ankitdebnath

    Hey @trickfun, to implement this functionality quickly, I have used the following approach:

    1. Added a new class 'custom-scroll' to the Load more button.
    2. Added 'hide' class to hide the Load More button.
    3. Created libraries.yml file and added a library.
    4. Created a JavaScript file, included it in the library, and attached the library to the field formatter (similar to how core/drupal.ajax is attached).
    5. In the JavaScript file, obtained the custom-scroll element and measured its height.
    6. After scrolling to a particular height, triggered a click event on the Load More button from the JavaScript file.

    I know this should not be the actual implementation of this, but I hope it helps.
    Let me know if you want more information.

Production build 0.71.5 2024