samedi 29 juillet 2017

Gallery round navigation swapImage issue

I'm trying to make it so on default the 1st round navigation circle is orange. (as the gallery would be on that picture by default when loading/refreshing the page)

The first circle (default picture) will not turn back to grey when going to the next image.

GIF (shows issue): http://ift.tt/2v9rD0Z

My code (html): http://ift.tt/2tMBYMJ

JS:

<script>
var prevSquare;

function swapImage(thisSquare) {
    if (prevSquare && prevSquare != thisSquare) {
prevSquare.src='../Images/gallerybutton1.png';
}
    thisSquare.src = '../Images/gallerybutton2.png';
prevSquare = thisSquare;
}
</script>

Apologies, adding the code in here does not seem to work hence why i used pastebin.

Kind regards.




Aucun commentaire:

Enregistrer un commentaire