Created
March 15, 2019 15:39
-
-
Save simonwuyts/1b157e7c5b26d8714d3d9be0403e9c38 to your computer and use it in GitHub Desktop.
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
<script> | |
function replaceFirstImage() { | |
var imageData = document.querySelector('[data-slideshow-history]').getAttribute('data-slideshow-url') | |
var visibleImage = document.querySelector('.slideshow__image__inner img') | |
$.getJSON(imageData, function(data) { | |
if (data.length > 1) { | |
var controls = document.querySelector('.slideshow__controls') | |
visibleImage.setAttribute('src', data[1].file) | |
controls.style.display = 'none' | |
} | |
}) | |
} | |
replaceFirstImage() | |
</script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment