How to load content on scrolling using jQuery and related plugins

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.

How to access full source code of an old commit

We use GitHub and Bitbucket for version controlling of our any web project and theme at TechnoCrews. Once in a while, we need to fully revert back to any web project. Sometimes, it is quite impossible to track an old commit after a longer period of time. So, what we do if we want to revert back to the old full source code of a project? How to access full source code of an old commit then? Well, there is no short cut way but it is possible to do it! Continue reading “How to access full source code of an old commit”

WordPress stylesheet with dynamic value

Passing some dynamic values to the stylesheet of WordPress using PHP, might be a great way to utilize custom values to the styling of any WP theme. Sometimes it becomes obvious to take certain inputs from the WordPress user like changing theme background , colors of certain portions etc. Continue reading “WordPress stylesheet with dynamic value”

7Zip Command Tutorial

To Install 7Zip in the VPS or in your linux:

If the output pointed that p7zip is already installed in your system, then you need to install 7z archiver as a command line utility. i.e full version. So, install the p7zip-full package.

Continue reading “7Zip Command Tutorial”