Created
May 12, 2017 14:06
-
-
Save zalesky/955ae9baa50c06cfbcc3605363121348 to your computer and use it in GitHub Desktop.
saves images
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
let IMG_CLASS = '.slide_image'; | |
let IMG_URL_ATTR = 'data-full'; | |
let imgName = 0; | |
[...document.querySelectorAll(IMG_CLASS)].map(el => setTimeout(() => { | |
let link = document.createElement('a'); | |
link.download = imgName++; | |
link.href = el.getAttribute(IMG_URL_ATTR) || el.getAttribute('src'); | |
document.body.appendChild(link); | |
link.click(); | |
document.body.removeChild(link); | |
delete link; | |
}, 500)); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment