Infinite Scroll JQuery Plugin

"convert your site into a treadmill with Javascript"

What is this?

HamsterWheel.js is an infinite scroll JQuery plugin that will let you convert sections of your site into an unending loop. Think of it like a treadmill (or hamsterwheel) made with Javascript. All you need is a section or two, and jQuery.

The content keeps coming with an unending loop!


Installation of hamster wheel should be fairly simple. Download the Production or the Dev version of the javascript, or click on the download button in the blue part of the page.

<body id="mySite">
  // need to have one root node inside of the body or in an iframe
  // Site Content
  <script type="text/javascript">


hamsterWheel.defaults = {
  autoscroll: true, //boolean
  infinite: true,   //boolean
  scrollSpeed: 40,  //number
  scrollDelta: 15,  //number
  clones: 6,        //number
  scrollbar: false  //boolean

autoScroll: Boolean
If true, the page will scroll on its own based on the scroll speed.
infinite: Boolean
This is the main purpose of the plugin, but if you decide you only want to loop through a section like, 5 times and have it spit you out into a footer, more power to you. Maybe jQuery .clone() would be better than this whole plugin but hey, im not judging you.
scrollSpeed: Number
This is for the autoscroll. Technically this is the number of milliseconds the page will wait before scrolling down one pixel, so you probably want to keep it somewhere between 10 and 50, but play around with it and see what works.
scrollDelta: Number
When you have autoscroll turned on, how fast does someone need to scroll to change the direction of the autoscroll? Defaults to 30.
clones: Number
How many times the content is cloned. 6 is a pretty good number, but if the page is huge and heavy you might want to lower this number, but id suggest 2 or 3 at the minimum.
scrollbar: Boolean
This will show or hide the scrollbar (in webkit based browsers). I like it off personally, it helps keep up the illusion.