I will show you how you can do this with the MoveToTop example plugin that I have created and placed on GitHub.
You don’t have to write a whole blown out plugin if you just want to add a simple code snipped or tweak to your site, plus you can use it in ANY of your sites you need this snippet.
To get this magic to work, the first thing you need to do is to write a basic HTML page with the plugin in question.Â The script (totop.js) has to be working along with the HTML (found in movetotop.php), CSS (totop.css)Â appropriate libraries such as J Query,Â Font Awesome.
I wrote a static HTML page and made this page work first.
In the next article, I will show you how I developed the test code.