function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Amit_Amit_ 

Lazy loading in visualforce page

Hi,
I have a requirement where I need to show some set of data in vf page and as the user scroll down the next set data should be displayed onto the page...kind of lazy loading...I dont have much I idea how to acheave this functionality any help is highly appriceated
thanks,
Sagar PareekSagar Pareek
You can use this jQuery  http://imakewebthings.com/jquery-waypoints/

Below is the simple way of calling a waypoints plugin and having the page load more Content once you reaches the bottom on scroll

$(document).ready(function() {
    var $loading = $("<div class='loading'><p>Loading more items&hellip;</p></div>"),
    $footer = $('footer'),
    opts = {
        offset: '100%'
    };

    $footer.waypoint(function(event, direction) {
        $footer.waypoint('remove');
        $('body').append($loading);
        $.get($('.more a').attr('href'), function(data) {
            var $data = $(data);
            $('#container').append($data.find('.article'));
            $loading.detach();
            $('.more').replaceWith($data.find('.more'));
            $footer.waypoint(opts);
        });
    }, opts);
});