slick images become 1px height

对着背影说爱祢 提交于 2019-12-25 08:07:34

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!