1

Lo que quiero realizar o mejor dicho saber es como puedo saber cuando mi atributo src se cambia, ya que actualmente tengo una galería de imágenes que cambian cada cierto tiempo mediante javascript.

    var imgArray = ["http://localhost:8080/GIBLO/Assets/Imagenes/Galeria1.jpg", "http://localhost:8080/GIBLO/Assets/Imagenes/Galeria2.jpg", "http://localhost:8080/GIBLO/Assets/Imagenes/Galeria3.jpg"];
    curIndex = 0;
    imgDuration = 5000;

function slideShow() {

    document.getElementById('Galeria').src = imgArray[curIndex];
    curIndex++;
    if (curIndex == imgArray.length) {
        curIndex = 0;
    }

    setTimeout("slideShow()", imgDuration);
}

Quiero saber cuando cambia mi src de mi tag img para que cada vez que cambie yo le pueda agregar un efecto a la transición.

Codigo HTML:

   <center><img id="Galeria" /></center>

1 respuesta 1

0

Utiliza la libreria https://cdn.rawgit.com/meetselva/attrchange/master/js/attrchange.js

Podrías utilizar para el atributo src de la etiqueta img

1

Tu Respuesta

By clicking “Publica tu respuesta”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

¿No es la respuesta que buscas? Examina otras preguntas con la etiqueta o formula tu propia pregunta.