How to populate infinite scroll with images from 1 directory?
<p>I have a <code>&lt;div id="content" class="clearfix"&gt;&lt;/div&gt;</code>  which self populates with a list of image urls from a separate directory on my server. </p>

<p>Here is the live URL for the site : <a href="http://ilovesmallies.com/forum/showcase.php" rel="nofollow">http://ilovesmallies.com/forum/showcase.php</a></p>

<p>I want to use infinite scroll and masonry plugins in this div. </p>

<p>However, I'm unsure of how to point towards a list of image urls with this script...</p>

<p>Here is how it is coded now and does not work. </p>

<pre><code>&lt;script&gt;
  $(function(){

    var $container = $('#content');

    $container.imagesLoaded(function(){
      $container.masonry({
        itemSelector: '.box',
        columnWidth: 250
      });
    });

    $container.infinitescroll({
      navSelector  : '#content',    // selector for the paged navigation 
      nextSelector : '#content a',  // selector for the NEXT link (to page 2)
      itemSelector : '.box',     // selector for all items you'll retrieve
      loading: {
          finishedMsg: 'No more pages to load.',
          img: 'http://i.imgur.com/6RMhx.gif'
        }
      },
      // trigger Masonry as a callback
      function( newElements ) {
        // hide new items while they are loading
        var $newElems = $( newElements ).css({ opacity: 0 });
        // ensure that images load before adding to masonry layout
        $newElems.imagesLoaded(function(){
          // show elems now they're ready
          $newElems.animate({ opacity: 1 });
          $container.masonry( 'appended', $newElems, true ); 
        });
      }
    );

  });
&lt;/script&gt;
</code></pre>
