How to know when the src property of an image changes its value?

1

What I want to do or better to know is how I can know when my src attribute is changed, since I currently have a gallery of images that change every so often through 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);
}

I want to know when my src changes from my tag img so that every time I change I can add an effect to the transition.

HTML code:

   <center><img id="Galeria" /></center>
    
asked by David 16.04.2018 в 01:06
source

1 answer

0

Use the library link

You could use the src attribute of the img

tag     
answered by 16.04.2018 в 09:51