Angular responsive images to fit parent dimensions.
I've been looking around and read your articles on responsive images. I have this working for me in vertical scroll situations:
-
Hi,
There isn't an option to automatically choose the height via the javascript method of automatically making responsive images, but if you're creating multiple versions for use in a srcset parameter via breakpoints, you could include different height options and have the browser choose one.
With the use of w_auto only, you may not need to change anything in your design provided the images have the correct aspect ratio either naturally, or enforced via your transformations, because the height will implicitly be linked with the width and you can account for that in your design
If you're using a grid layout, for example, you could enforce an aspect ratio of 1:1 and get all square images: http://res.cloudinary.com/demo/image/upload/c_fill,w_auto,dpr_1.0,ar_1:1,g_auto/v1/sample
Please let me know if that helps, and if there's anything else I can help with0 -
Thanks so much. It did work for me.
Could not reply that time.
Thanks.
0
Post is closed for comments.
Comments
2 comments