我正在使用minimal theme
inShopify
并创建了一个slideshow
包含 4 个图像的图像,但它是垂直显示而不是水平显示的。如何将其更改为水平显示而不是垂直显示。我曾尝试寻找解决方案,但似乎找不到。下面是我尝试获取水平显示的多图像滑块的代码。附上的图片是我想要实现的。
HTML
<div class="container">
<div class="row">
<div class="col-md-12 heroSlider-fixed">
<div class="overlay">
</div>
<!-- Slider -->
<div class="slider responsive">
<div>
<img src="https://cdn.shopify.com/s/files/1/0080/8235/8334/files/shoes.PNG?11833828067426270267" alt="shoes" height="100" width="100" />
</div>
<div>
<img src="https://cdn.shopify.com/s/files/1/0080/8235/8334/files/bags.PNG?11833828067426270267" alt="bags" height="100" width="100" />
</div>
<div>
<img src="https://cdn.shopify.com/s/files/1/0080/8235/8334/files/Clothing.PNG?11833828067426270267" alt="clothing" height="100" width="100" />
</div>
<div>
<img src="https://cdn.shopify.com/s/files/1/0080/8235/8334/files/formal.PNG?11833828067426270267" alt="formal" height="100" width="100" />
</div>
</div>
<!-- control arrows -->
<div class="prev">
<span class="glyphicon glyphicon-chevron-left" aria-hidden="true"></span>
</div>
<div class="next">
<span class="glyphicon glyphicon-chevron-right" aria-hidden="true"></span>
</div>
</div>
</div>
CSS
<style>
html {box-sizing: border-box;}
*, *:before, *:after {box-sizing: inherit;}
img {
width: 100%;
height: auto;
padding: 5px;
}
.slick-dots {
text-align: center;
margin: 0 0 10px 0;
padding: 0;
li {
display:inline-block;
margin-left: 4px;
margin-right: 4px;
&.slick-active {
button {
background-color:black;
}
}
button {
font: 0/0 a;
text-shadow: none;
color: transparent;
background-color:#999;
border:none;
width: 15px;
height: 15px;
border-radius:50%;
}
:hover{
background-color: black;
}
}
}
/* Custom Arrow */
.prev{
color: #999;
position: absolute;
top: 38%;
left: -2em;
font-size: 1.5em;
:hover{
cursor: pointer;
color: black;
}
}
.next{
color: #999;
position: absolute;
top: 38%;
right: -2em;
font-size: 1.5em;
:hover{
cursor: pointer;
color: black;
}
}
@media screen and (max-width: 800px) {
.next {
display: none !important;
}
}
</style>
Javascript
<script>
$('.responsive').slick({
dots: true,
prevArrow: $('.prev'),
nextArrow: $('.next'),
infinite: false,
speed: 300,
slidesToShow: 4,
slidesToScroll: 4,
responsive: [
{
breakpoint: 1024,
settings: {
slidesToShow: 3,
slidesToScroll: 3,
infinite: true,
dots: true
}
},
{
breakpoint: 600,
settings: {
slidesToShow: 2,
slidesToScroll: 2
}
},
{
breakpoint: 480,
settings: {
slidesToShow: 1,
slidesToScroll: 1
}
}
// You can unslick at a given breakpoint now by adding:
// settings: "unslick"
// instead of a settings object
]
});
</script>
任何链接或代码更改将不胜感激。