slider-pro icon indicating copy to clipboard operation
slider-pro copied to clipboard

Set viewport relative height

Open suntrop opened this issue 8 years ago • 2 comments

I made the parent of .slider-pro 50vh and set the height property to "50%" but the sildes aren't visible (0px height). If I set the height property to "50vh" the photo is scaled down in its width as well. But I want it to be 100% x 50% (of the viewport/parent element). IS something wrong or is slider pro not capable of that?

http://codepen.io/suntrop/pen/NdpYrM?editors=1010

suntrop avatar Jan 20 '17 12:01 suntrop

Hi. I suppose you've figured it out because it seems to be working now, the slides are appearing. Let me know if I'm missing something.

Cheers

davidghi avatar Jan 30 '17 14:01 davidghi

Hi. Unfortunately no. It doesn't work and I did not find any solution. I have changed the pen a little bit, maybe that shows better what I meant.

The height of my wrapper (dashed border) is now 70vh But the image is 300px … and I want it be fully extend to the wrapper (width and height, like CSS cover). When I set slider-pro to autoHeight it uses the image height. When I set the height to vh it uses the correct height, but ignores the width (100%). When I set the height to % it doesn't work at all.

suntrop avatar Jan 31 '17 09:01 suntrop