Skip to content

Instantly share code, notes, and snippets.

@stillio-support
Last active June 30, 2021 08:58
Show Gist options
  • Select an option

  • Save stillio-support/9f796d43f4bf9cc92ac9c422ef845bec to your computer and use it in GitHub Desktop.

Select an option

Save stillio-support/9f796d43f4bf9cc92ac9c422ef845bec to your computer and use it in GitHub Desktop.
<script>
(function() {
let stillioDivs = Array.from(document.querySelectorAll('div[data-stillio]'))
stillioDivs.forEach((element) => {
let imgSource = element.getAttribute('data-stillio')
let imgTag = document.createElement('img')
let utc = new Date().getTime();
let newSource = `${imgSource}?${utc}`
imgTag.src = newSource
imgTag.srcset = newSource
imgTag.currentSrc = newSource
element.appendChild(imgTag)
})
})()
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment