MyBB Community Forums

Full Version: Endless scrolling in MyBB?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2 3 4 5 6 7 8
great, thanks! will give it a try tomorrow
<script type="text/javascript">
jQuery(function($) {
$.ias({
  container     : '.looksthreads',
  item        : '.item',
  pagination    : '.pagination',
  next        : 'a.pagination_next',
  loader    : '<img src="/images/spinner.gif">',
  onLoadItems: function(items) {
        // hide new items while they are loading
        var $newElems = $(items).show().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 });
          $('.listing').masonry( 'appended', $newElems, true );
        });
        return true;
    }
});
});
</script>

Is there something wrong with the syntax here? Confused Also, I have no idea what's supposed to go where .listing is.
I believe .looksthreads is what would go where .listing is.
OK, thanks. I'll try that. But syntax is stopping the script from running at this point ...
or I may have read that wrong
Bump >>;
Hm, your syntax appears to be fine (my code editor thinks so too xD).

Any chance you could post the error you're getting?
(2013-04-07, 09:06 PM)brad-t Wrote: [ -> ]Also, I have no idea what's supposed to go where .listing is.

I think you might want .looksthreads (or your container) there, judging by context and choice of default name.
No error, it just stops executing. Here's the sample from Ajax scrolling github page:

jQuery.ias({
    container : '.listing',
    item: '.post',
    pagination: '#content .navigation',
    next: '.next-posts a',
    loader: '<img src="images/loader.gif"/>',
    onLoadItems: function(items) {
        // hide new items while they are loading
        var $newElems = $(items).show().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 });
          $('.listing').masonry( 'appended', $newElems, true );
        });
        return true;
    }
});
Anyone willing to give this a shot on my site? This is really holding me up.
Pages: 1 2 3 4 5 6 7 8