gpt4 book ai didi

jquery - BxSlider Carousel vertical-arrow vertical 以及

转载 作者:太空宇宙 更新时间:2023-11-04 16:07:43 34 4
gpt4 key购买 nike

我将 bxSlider 用于轮播。它提供水平和垂直模式,这很好。

唯一的问题是在垂直显示时,箭头仍然保持在水平位置。

HTML 代码:

<div class="sliderLocation">
<div class="slide"><img src="http://placehold.it/300x150&text=FooBar6"></div>
<div class="slide"><img src="http://placehold.it/300x150&text=FooBar7"></div>
<div class="slide"><img src="http://placehold.it/300x150&text=FooBar8"></div>
<div class="slide"><img src="http://placehold.it/300x150&text=FooBar9"></div>
<div class="slide"><img src="http://placehold.it/300x150&text=FooBar10"></div>
</div>

JS

$('.sliderLocation').bxSlider({
slideWidth: 200,
minSlides: 3,
maxSlides: 3,
moveSlides: 1,
slideMargin: 10,
pager: false,
mode: 'vertical'
});

CSS在线查看。我使用默认的:http://bxslider.com/

enter image description here

和垂直:箭头进入左侧和右侧,我希望它们移动到顶部和底部:

enter image description here

最佳答案

custom.css 中覆盖 bxslider.css 的样式,如下所示。

注意:我不得不使用 important 因为代码片段,但是如果你将 custom.css 放在 bxslider.css 之后并使用正确的特异性,你将不需要 !important

$('.sliderLocation').bxSlider({
slideWidth: 200,
minSlides: 3,
maxSlides: 3,
moveSlides: 1,
slideMargin: 10,
pager: false,
mode: 'vertical'
});
/*Custom CSS that should put after BxSlider.css file*/

.bx-wrapper {
margin-top: 50px !important
}
.bx-controls a {
transform: rotate(90deg);
left: 45% !important;
top: 0 !important;
bottom: 0!important;
right: 0 !important;
}
.bx-controls .bx-prev {
top: -30px !important;
}
.bx-controls .bx-next {
top: 350px !important;
}
<link href="https://cdnjs.cloudflare.com/ajax/libs/bxslider/4.2.5/jquery.bxslider.min.css" rel="stylesheet" />
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/bxslider/4.2.5/jquery.bxslider.min.js"></script>
<div class="sliderLocation">
<div class="slide">
<img src="http://placehold.it/300x150&text=FooBar6">
</div>
<div class="slide">
<img src="http://placehold.it/300x150&text=FooBar7">
</div>
<div class="slide">
<img src="http://placehold.it/300x150&text=FooBar8">
</div>
<div class="slide">
<img src="http://placehold.it/300x150&text=FooBar9">
</div>
<div class="slide">
<img src="http://placehold.it/300x150&text=FooBar10">
</div>
</div>

关于jquery - BxSlider Carousel vertical-arrow vertical 以及,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36745880/

34 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com