woocommerce / FlexSlider

An awesome, fully responsive jQuery slider plugin
http://www.woocommerce.com/flexslider/
GNU General Public License v2.0
4.91k stars 1.69k forks source link

Disable flexslider grow #1660

Closed JosephP91 closed 7 years ago

JosephP91 commented 7 years ago

Hi, I would like to display different size images using flexslider. When an image is taller than another, the entire flexslider resize itself and I would like to disable this effect. Is it possible to display every image without resizing the container? Thank you

jeffikus commented 7 years ago

You can fix the height, but then you would have the background showing where the "white space" areas are, if that's ok then sure, can you pop a snippet of code that you are using so I can take a look?

JosephP91 commented 7 years ago

Hi @jeffikus I solved using the following style on the img item:

style="width: auto; height: auto; max-height: 480px; display:block; object-fit: cover; margin: 0 auto;"

In this way I can center the image and removed the resize effect.