miromannino / Justified-Gallery

Javascript library to help creating high quality justified galleries of images. Used by thousands of websites as well as the photography community 500px.
http://miromannino.github.io/Justified-Gallery/
MIT License
1.68k stars 299 forks source link

Error Image #284

Open ys2n opened 6 years ago

ys2n commented 6 years ago

Currently, if the image in a gallery is missing (e.g. a 404), the image is omitted. Is there a way to use a replacement image instead?

az-oolloow commented 4 years ago

Any updates on this?

Sija commented 4 years ago

you can always use

$(img).on('error', () => { $(img).attr('src', 'fallback-url') })

:)

wangshuangqin-hub commented 2 years ago

I use it in Vue, but by default, the width and height of the image are all 0, so it cannot be rendered on the page imgErrorimg(e){ e.target.src = require('../../assets/images/default/picture.svg'); } Snipaste_2022-08-26_17-00-39