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:
Top 10 WordPress Magazine Theme of October 2013

As a Freelance WordPress Designer - Developer, I always work with lots of theme from various theme marketplace. Most of...

How to Retrieve Hacked WordPress Website

You are sure to get nervous when WordPress like other software’s will break down and trouble. This malfunctions may occur...