samjonesigd / vue-image-zoomer

Image zoom component for Vue.js
https://samueljon.es/vue-image-zoomer
MIT License
103 stars 10 forks source link

regular image size property #7

Closed mafrego closed 3 years ago

mafrego commented 3 years ago

Hi Sam,

would it be possible to add a property to insert the regular image size (height/width) so that browsers can calculate the actual height BEFORE the image is loaded. This avoid that the content jumps as soon as the images is loaded. https://css-tricks.com/preventing-content-reflow-from-lazy-loaded-images

Thanks!

samjonesigd commented 3 years ago

@mafrego There is an lazy-placeholder prop which I think works better? Then you don't have to set a width and height.

You can use a small file sized image, one colour or transparent.

Or I can implement an image-dimension prop if really needed.

You can also use css to do what you want to do.