Title: [Plugin : Infinite Scroll] Javascript not loading on scroll
Last modified: August 20, 2016

---

# [Plugin : Infinite Scroll] Javascript not loading on scroll

 *  [trakout](https://wordpress.org/support/users/trakout/)
 * (@trakout)
 * [14 years, 3 months ago](https://wordpress.org/support/topic/plugin-infinite-scroll-javascript-not-loading-on-scroll/)
 * Hi all,
 * I’m running a custom theme made from scratch, trying to implement Infinite Scroll.
   
   The wp plugin didn’t work, so I hardcoded it, got the css selectors right, and
   it appears to work.
 * I have two divs in my post div, the latter of which I added in to simplify things.
   One of those divs is an image box, which rotates by using links that use javascript
   to change the image.
 * However there’s an issue where the javascript used to control those images basically
   breaks. For example, if I have 4 ‘posts’ per page (each consisting of this image
   +control div), the first 4 load fine. I’ve verified this by debugging with alert();,
   which gives me 4 popups, 1 per post. However when I scroll down, upon triggering
   the scroll, it will only alert once, and that’s literally the only javascript
   that appears to work. My ‘image gallery’ is rendered useless on any page >= 2.
 * Does anyone have any suggestions?
 * A couple notes, something odd that I noticed is that my $jq(‘#content’).infinitescroll();
   only works when it’s nearly at the end of my code, like we’re talking it only
   works when I insert it after the navigation links div. (Isn’t it supposed to 
   work in head, or am I wrong?)
 * Also, the reason it’s $jq and not $, or jQuery, is because I’m using jQuery in
   the imagebox control div, and $jq for infinite scroll.
 * Hence, this is my header:
 *     ```
       <head>
       ...
       <script src="http://code.jquery.com/jquery-1.7.1.js"></script>
       <script>
         var $jq = jQuery.noConflict();
       </script>
       <script src="<?php bloginfo('template_directory'); ?>/js/jquery.infinitescroll.js"></script>
       </head>
       ```
   

Viewing 1 replies (of 1 total)

 *  Thread Starter [trakout](https://wordpress.org/support/users/trakout/)
 * (@trakout)
 * [14 years, 3 months ago](https://wordpress.org/support/topic/plugin-infinite-scroll-javascript-not-loading-on-scroll/#post-2625218)
 * For anyone wanting to see what I’m working with, [here’s a link to the site](http://www.nullrefer.com/a2lja3NvbmFwbGFuZS5jb20=.shtml),
   without any Infinite scrolling code.
 * Also, it’s worth noting that my problem feels a _lot_ like [this](http://wordpress.org/support/topic/shutter-reloaded-and-infinite-scroll),
   especially with regard to the words “working on the first page, but not on subsequent
   pages.”

Viewing 1 replies (of 1 total)

The topic ‘[Plugin : Infinite Scroll] Javascript not loading on scroll’ is closed
to new replies.

## Tags

 * [javascript](https://wordpress.org/support/topic-tag/javascript/)

 * 1 reply
 * 1 participant
 * Last reply from: [trakout](https://wordpress.org/support/users/trakout/)
 * Last activity: [14 years, 3 months ago](https://wordpress.org/support/topic/plugin-infinite-scroll-javascript-not-loading-on-scroll/#post-2625218)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
