How to load content on scrolling using jQuery and related plugins

Spread the love

In this article, I am going to show you how you can load certain portion of code only when the content is scrolled down and appeared on the screen. i.e to the viewport. To load content on scrolling we need a jQuery plugin named viewport. It is one of the easiest to use for such types of operation. I am using Barfiller jQuery plugin to demonstrate the plugin. It will start progressing once scroll down to that portion.

The end result will be something like this:  Demo | Download Code

To load content on scrolling, first Download bar filler and viewport plugin.

Link the viewport JS file to the head ( I have added on the head). It should work before the close of the body tag too. I have included the bar-filler plugin on the footer.


The Viewport is just some special selector added to our jQuery. It adds the following selector. Please check  the site of Viewport to have more information.


Now The code that you want to appear once after it loaded to the viewport, i.e to load content on scrolling , add a div with any id. I have added a div with id named “progress”.

Now add the following code to the end of the body. i.e before </body>

Here, after the document is ready we are checking for the scroll event. then each scrolled event we are selecting the special selector provided by viewport plugin :in-viewport. then for each item, we are calling the bar filler. You can call any code here.

You are done! Hope you understood. Let me know if you have any problem. If you have a better solution, please let me know by commenting.

Spread the love

Submit a Comment

Must be required * marked fields.


Related Articles

Mizanur Rahaman Mizan

7Zip Command Tutorial

Spread the love

Spread the loveTo Install 7Zip in the VPS or in your linux:

If the output

Spread the love
Read more:
Listing all files and directories using PHP

Have you ever wondered how without an index file all files and directories are appearing in your web root? Or...

Search Engine Optimization (SEO) Explained

This article is  written focusing to help the novice webmasters or website owners to learn the terms SEO (Search Engine...