问题
I have been trying to get a slick slider to work for a few hours now, and after trying all the suggestions on relevant SO questions, nothing has worked.
My images are 1080px tall, but slick displays them as 1px tall.
FYI, the images have enough transparent space at the bottom and I am planning to move the dots up on top of the image to keep the page without scroll bars. I am also planning to make the navigation arrows smaller, though they should still be on top of the image.
I have the entire slider having the full height as well as the everything within (.fullheight
and .backimg
).
<div id="picslider" style="height: 100%">
<a href="#" class="fullheight"><img src="https://octolopagon.games/_resources/img/olumian.png" class="backimg"></a>
<a href="#" class="fullheight"><img src="https://octolopagon.games/_resources/img/support.png" class="backimg"></a>
</div>
The full code is at https://jsfiddle.net/wrtvq2we/
Any help is appreciated.
回答1:
You should give the container where the slides are in a height, otherwise the height will always be 1px. So you can give .slick-track
a height desired to your needs. Here's an updated JSfiddle.
The images that are inside the slider will grow (in height and width) to the set height of the container.
来源:https://stackoverflow.com/questions/41771891/slick-images-become-1px-height