Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

infinite scroll without loading image

I have looked everywhere to try and figure out how to use infinite scroll and not have a loading image, but I cannot find it. This is how you set it up loading text and image:

loading: {
    img: "/img/loading.gif",
    msgText: "Loading new posts..."
}

if i set msgText to '' then there will be no text, yet I cannot seem to do the same with the loading image as if I set it to a blank string, it will display the error image image.

How can I use infinite scroll with no loading image?

infinite-scroll

note that the loading image and text is incorrect syntax on that page, you can see the correct syntax here

like image 398
Ryan Saxe Avatar asked Dec 06 '22 06:12

Ryan Saxe


1 Answers

You could use a base64 encoded 1x1 pixel transparent image:

img: 'data:image/gif;base64,R0lGODlhAQABAIAAAP///////yH5BAEKAAEALAAAAAABAAEAAAICTAEAOw=='

This way you avoid sending lots of headers to download a tiny image.


Edit: From smallest filesize for transparent single pixel image, you could also use the shorter

img: 'data:image/gif;base64,R0lGODlhAQABAHAAACH5BAUAAAAALAAAAAABAAEAAAICRAEAOw=='
like image 109
Oriol Avatar answered Dec 08 '22 20:12

Oriol