srobbin/jquery-backstretch — pull request #213 by mpal9000 (2013-03-13 18:47:05+00:00)
Title: Fix for github issue #200. Hides images instead of removing them.

Hello and thanks for sharing this script!

For me chrome & chromium do the right thing. If the cache is disabled the request should be repeated, because the image that we want has been removed from the DOM.

Now in slideshow mode each user with disabled cache, hits the server with one request per "duration" without a reason, because the response is always "304".

If we build the same functionality with CSS the images are requested only once. I think this is what this script should imitate and extend.

The main change in this pull-request is that backstrech preloads & appends all the images to the DOM and then hides the previous images instead of removing them. Only one request for each image. Also, "resize()" call in the "show()" method moved before the fade-in.

From performance perspective I think jQuery's "hide()" is close to "remove()" because it applies the "display: none" property, so the browser doesn't really care about the hidden images while painting and rendering.