kthornbloom / Smoothproducts

A simple, lightweight and responsive product image viewer using jQuery
kthornbloom.com/smoothproducts
185 stars 89 forks source link

Max height #15

Open chlebta opened 9 years ago

chlebta commented 9 years ago

Hello, Thank's for this nice and simple library. I need to know how can I set max height like the max-width property ? Also is it possible to fix height and width of library ?

kthornbloom commented 9 years ago

I need to know how can I set max height like the max-width property? This plugin automatically sets the height based on the image you're viewing. It's not currently set up with a max-height option since most responsive elements can just use whatever height they need as long as the width fits the page.

Also is it possible to fix height and width of library? Are you asking if you can set a width and height for the thumbnail images? Look at lines 45 - 52 in smoothproducts.css to change these values.

chlebta commented 9 years ago

I mean fix height and width for the library not for thumbnails, Like in sales sites it has always same size and width

andynoelker commented 8 years ago

I believe you want the viewer itself to always have a fixed height, instead of automatically adjusting based on the image size currently being viewed?

The easiest (albeit a bit hackish) way to do that is to either modify smoothproducts.css or write your own css script that overwrites the sp-large class.

For instance, in smoothproducts.css on line 77 add a height to sp-large:

.sp-large {
    position: relative;
    overflow: hidden;
    top: 0;
    left: 0;
    height: 500px !important;
}

This will make the main image space exactly 500 px tall. By default, all images that are too tall will be cut off, but if you wanted to change how the overflow worked, just adjust that overflow property and make it important (ex: overflow: scroll !important).