We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date
Unfortunately, activation email could not send to your email. Please try again.
Essential JS2

Syncfusion jQuery based widgets are no longer in active development. Switch to our pure JavaScript based next generation Essential JS 2 library.

Syncfusion Feedback

How to achieve virtual scrolling for contents using the ejScroller?

Platform: jQuery |
Control: ejScroller
Tags: javascript

How to achieve virtual scrolling for contents using the ejScroller?

What is Virtual Scrolling?

The virtual scrolling is used to display the large amounts of records without paging. When scrolling with the vertical scrollbar, AJAX requests will be executed to load and refresh the existing records.

How to achieve this virtual scrolling?

We can achieve this virtual scrolling in ejScroller using our existing event “scroll” and method “refresh” of ejScroller.

“Scroll” event will be trigger at that time of scrolling and the refresh method used to refresh the vertical scrollbar handle based on height of the target area content.

When the scroll bar handle reaches its end points we can upload the data using AJAX request in scroll event. Also we need to call refresh methods to refresh the scroll bar based on current content (after new content loaded success fully).

Please refer the below code snippet

contentLoaded = false;


scroll: function (e) {

if (obj) {


if (!contentLoaded && (document.getElementsByClassName("sampleContent")[0].scrollHeight-e.scrollTop) <= obj.option("height")) {


url: "../Content/samplecontent/mvccontent.html", success: function (result) {

newitem = $("




contentLoaded = true;


obj.option("scrollTop", scroll);







obj = $("#scrollcontent").data("ejScroller");

In this code, document.getElementsByClassName("sampleContent")[0].scrollHeight-e.scrollTop > obj.option(“height”) is used to find whether the vertical scroll bar handle reaches is end points in scroll bar. When the handle is reaches its end points, we have loaded the data and then appends this to target pane of scroll bar.

Like this whenever the scroll bar’s vertical handle reaches its end points another new content will be loaded and this process will be continued until all the contents will get loaded successfully.

SampleVirtual scrolling using scroller

You must log in to leave a comment

Please sign in to access our KB

This page will automatically be redirected to the sign-in page in 10 seconds.

Up arrow icon

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

Live Chat Icon For mobile