Skip to content

Instantly share code, notes, and snippets.

@bernatfortet
Created January 27, 2014 19:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bernatfortet/8655416 to your computer and use it in GitHub Desktop.
Save bernatfortet/8655416 to your computer and use it in GitHub Desktop.
$('.post').each(function(i){
var _this = this;
if( i > 50 && i < 100 ){
setTimeout(function(){
var imgUrl = $(_this).find('img').attr("src");
var a = document.createElement('a');
a.href = imgUrl;
a.setAttribute("download","img.png");
document.body.appendChild( a )
a.click();
}, 100)
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment