I have some related code on my Shopify site written by a previous developer whom I am no longer able to get in contact with and for some reason, whilst the code works fine when there is 5 or more related products, when there are 4 or fewer it causes a strange zoom out effect on the products.
This is easier to show with images:
Good version (URL here: https://www.sconch.com/collections/yarn/products/king-cole-timeless-chunky):
Bad version ()https://www.sconch.com/collections/yarn/products/james-c-brett-marble-chunky:
Any help with where to even start would be much appreciated!
2
Answers
I have been able to solve this by implementing the following CSS code:
This means the JS correctly calculates the size of each element regardless of how many are in the slider.
This CSS edit was suggested by @kenwheeler in this post: https://github.com/kenwheeler/slick/issues/1504#issuecomment-489618312
you are using
slick-slide
, the plug-in set the width of the itemsthis is the script from your webpage,
the
slick-slide
is code for 5 items with different break point;