Skip to content

Instantly share code, notes, and snippets.

@MrSwed
Created March 20, 2024 13:10
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 MrSwed/ca266bd6086d41b8d00da58b63d55729 to your computer and use it in GitHub Desktop.
Save MrSwed/ca266bd6086d41b8d00da58b63d55729 to your computer and use it in GitHub Desktop.
retry load not loaded img on site page with too mane photos
jQuery(function(jQuery){
function catalogLoad() {
let l = $("img[src*=photo]").filter(function(i){return this.naturalWidth==0; }).each(function(i){this.src=this.src}).length
console.log("try load "+l+" img")
if (l>0) {
setTimeout(catalogLoad, 3000);
}
}
setTimeout(catalogLoad, 3000);
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment