0

Im wondering if its possible to display a loading gif on this custom jquery.

I just want to show a gif at the footer on each scroll down just as infinite-scroll has implemented.

http://jsfiddle.net/barrycorrigan/4Ur6R/

jQuery(function() {

/**
    * Reveal Sections as the users scrolls - Development Ongoing
    * Get the nth div of class content, where n is the contentNumber, and make it shown
    * Set intital divs to be hidden
*/

jQuery(".mine").addClass("noshow");
var contentNumber = 0;

function reveal() {
    var constraintNumber = contentNumber + 12;
    //IMPORTANT - DO NOT DELETE
    jQuery(window).trigger('resize');
    //IMPORTANT - DO NOT DELETE
    for (i = contentNumber; i < constraintNumber; i++) {
        //Get the nth div of class content, where n is the contentNumber, and make it shown
        jQuery('.mine').eq(contentNumber).removeClass("noshow");
        contentNumber ++;
    }
}

//Window scroll function
jQuery(window).scroll(function() {
   if (jQuery(window).scrollTop() >= jQuery(document).height() - jQuery(window).height() - 800) 
    {
        reveal();
    }
});
reveal();

});

StudioHeads
  • 31
  • 1
  • 9

0 Answers0