fix typo (rr)

This commit is contained in:
Yannik Schmidt
2018-12-17 10:27:44 +01:00
parent 59708667ac
commit 4bd3479a6d

View File

@@ -18,15 +18,15 @@ function changeSrc(offset){
/* cache */ /* cache */
if(elements == null){ if(elements == null){
elements = document.querySelectorAll("*[rrealsrc]"); elements = document.querySelectorAll("*[realsrc]");
} }
for (var i = counter; i < elements.length; i++) { for (var i = counter; i < elements.length; i++) {
var boundingClientRect = elements[i].getBoundingClientRect(); var boundingClientRect = elements[i].getBoundingClientRect();
if (elements[i].hasAttribute("rrealsrc") if (elements[i].hasAttribute("realsrc")
&& boundingClientRect.top < window.innerHeight + offset) { && boundingClientRect.top < window.innerHeight + offset) {
elements[i].style.backgroundImage = newSrc; elements[i].style.backgroundImage = newSrc;
elements[i].removeAttribute("rrealsrc"); elements[i].removeAttribute("realsrc");
}else{ }else{
/* DOM is parsed top down and images are inserted in that order too */ /* DOM is parsed top down and images are inserted in that order too */
/* meaing that once we reach pic that insnt in viewbox none following will be*/ /* meaing that once we reach pic that insnt in viewbox none following will be*/