Created
March 31, 2016 16:25
-
-
Save UlisesGascon/57ed4ed61fbc987b0e3265568a27f6c4 to your computer and use it in GitHub Desktop.
Cambiar las fotos de Genbeta por fotos de gatitos
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var imagenes = document.querySelectorAll('.article-home-figure img'); | |
var imagenesLog = []; | |
for(var i = 0; i < imagenes.length; i++){ | |
var url = document.querySelectorAll('.article-home-figure img')[i].src; | |
var ancho = document.querySelectorAll('.article-home-figure img')[i].width; | |
var alto = document.querySelectorAll('.article-home-figure img')[i].height; | |
var sustituto = "http://lorempixel.com/"+ancho+"/"+alto+"/cats"; | |
var datos = [url, ancho, alto, sustituto] | |
imagenesLog.push(datos); | |
document.querySelectorAll('.article-home-figure img')[i].src = sustituto; | |
document.querySelectorAll('.article-home-figure img')[i].srcset = sustituto +" "+ancho+"w", sustituto +" "+ancho+"w"; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment