0

i am trying to implement a very simple infinite scroll function within my twitter feed. I am displaying 4 tweets at a time and then when a user hits the bottom of the page i would like to load another 4, and so on.

So far i have come up with this

$(window).scroll(function () {
    if ($(window).scrollTop() >= $(document).height() - $(window).height() - 100) {
        $('.tweet').slice(4).show();
    } else {
        $('.tweet').slice(4).hide();
    }
}); 

however all i get is a glitch at the bottom of my page when trying to scroll down to the next set of tweets, which at the moment is everything past the fourth tweet, not sets of 4 tweets.

Everything is in a container called #jstwitter.. How would i implement such a thing?

Thanks

palaѕн
  • 64,836
  • 15
  • 100
  • 121
Richlewis
  • 13,978
  • 32
  • 103
  • 238

0 Answers0