gpt4 book ai didi

jquery - 光滑的 slider 箭头在响应模式下表现得像幻灯片

转载 作者:搜寻专家 更新时间:2023-10-31 23:25:04 25 4
gpt4 key购买 nike

我已经为我的 bootstrap 元素集成了 slick carousel,并且我已经修改了 slick-theme.css 以进行一些自定义。我遇到了这个奇怪的问题,它在响应模式下 slider 全部出错并且幻灯片正在复制并且箭头(它们被自定义为下一个和上一个按钮)显示为幻灯片。当我删除响应参数时,它可以正常工作。我想删除小屏幕尺寸的箭头。如果有人可以帮助我解决这个问题,那就太好了。谢谢。

PS:编辑后的 ​​slick-theme.css 文件的代码位于此代码段的 css 部分的底部。

 $(window).load(function () {
$('.slider-main').slick({
arrows: true,
dots: false,
prevArrow: "<a class=\"slick-prev slider-slick-prev\">PREVIOUS</a>",
nextArrow: "<a class=\"slick-next slider-slick-next\">NEXT</a>",
slidesToShow: 1,
slidesToScroll: 1,
responsive: [
{
breakpoint: 767,
settings: {
arrows: false
}
}
]
});
});
.slider > div {
padding: 0 40px;
}

@media only screen and (max-width: 1200px) {
.slider > div {
padding: 0 10px;
}
}

.slider > div .slider-left {
padding: 0 16px 0 23px;
text-align: center;
}

@media only screen and (max-width: 1200px) {
.slider > div .slider-left {
padding: 0 5px 0 0;
}
}

@media only screen and (max-width: 767px) {
.slider > div .slider-left {
display: none;
}
}

.slider > div .slider-left > div {
border-left: 1px solid #e8e8e8;
border-right: 1px solid #e8e8e8;
border-bottom: 1px solid #e8e8e8;
margin-top: 13px;
}

.slider > div .slider-left > div > h2 {
background: #bbe3de;
color: #ffffff;
font-size: 21.36px;
margin: 0;
padding: 18px 0;
}

@media only screen and (max-width: 1200px) {
.slider > div .slider-left > div > h2 {
font-size: 19.36px;
padding: 18px 10px;
}
}

.slider > div .slider-left > div > div.left-description {
color: #afafaf;
font-size: 25px;
margin-top: 35px;
line-height: 1.2;
padding: 0 23px;
}

@media only screen and (max-width: 1200px) {
.slider > div .slider-left > div > div.left-description {
margin-top: 5px;
font-size: 17px;
padding: 0 5px;
}
}

.slider > div .slider-left > div > div.left-info {
color: #9d9d9d;
font-size: 17px;
margin-top: 28px;
line-height: 1.2;
padding: 0 4px;
}

@media only screen and (max-width: 1200px) {
.slider > div .slider-left > div > div.left-info {
margin-top: 5px;
}
}

.slider > div .slider-left > div > div.left-location {
color: #9d9d9d;
font-size: 25px;
margin-top: 2px;
}

@media only screen and (max-width: 1200px) {
.slider > div .slider-left > div > div.left-location {
font-size: 17px;
}
}

.slider > div .slider-left > div > div.left-read-more {
margin-top: 16px;
margin-bottom: 18px;
}

@media only screen and (max-width: 1200px) {
.slider > div .slider-left > div > div.left-read-more {
margin-top: 5px;
}
}

.slider > div .slider-left > div > div.left-read-more a {
color: #ec6b9c;
font-size: 22.29px;
-webkit-transition: color 0.2s ease;
-moz-transition: color 0.2s ease;
-ms-transition: color 0.2s ease;
-o-transition: color 0.2s ease;
transition: color 0.2s ease;
}

@media only screen and (max-width: 1200px) {
.slider > div .slider-left > div > div.left-read-more a {
font-size: 17px;
}
}

.slider > div .slider-left > div > div.left-read-more a:hover {
color: #bbe3de;
}

.slider > div .slider-main {
padding: 13px 39px 0 16px;
}

@media only screen and (max-width: 1200px) {
.slider > div .slider-main {
padding: 13px 0 0 5px;
}
}

.slider > div .slider-main .single-slide {
outline: none;
}

.slider > div .slider-main .single-slide:hover {
outline: none;
}

.slider > div .slider-main .single-slide:focus {
outline: none;
}

.slider > div .slider-main .single-slide img {
width: 100%;
outline: none;
}

.slider > div .slider-main .single-slide img:hover {
outline: none;
}

.slider > div .slider-main .single-slide img:focus {
outline: none;
}

.slider > div .slider-main .single-slide .slide-description {
position: absolute;
bottom: 18px;
right: 0;
text-transform: uppercase;
background: #ffffff;
padding: 10px 21px 5px 18px;
letter-spacing: -0.3px;
color: #878787;
font-size: 22.37px;
}

.slider > div .slider-main .single-slide .slide-description a {
margin-left: 4px;
letter-spacing: 0.5px;
display: inline-block;
color: #ec6b9c;
font-size: 15px;
-webkit-transition: color 0.2s ease;
-moz-transition: color 0.2s ease;
-ms-transition: color 0.2s ease;
-o-transition: color 0.2s ease;
transition: color 0.2s ease;
}

.slider > div .slider-main .single-slide .slide-description a:hover {
color: #bbe3de;
}

.slider > div .slider-left-mobile {
padding: 0 16px 0 23px;
text-align: center;
}

.slider > div .slider-left-mobile > div {
border-left: 1px solid #e8e8e8;
border-right: 1px solid #e8e8e8;
border-bottom: 1px solid #e8e8e8;
margin-top: 13px;
}

.slider > div .slider-left-mobile > div > h2 {
background: #bbe3de;
color: #ffffff;
font-size: 21.36px;
margin: 0;
padding: 18px 0;
}

.slider > div .slider-left-mobile > div > div.left-description {
color: #afafaf;
font-size: 25px;
margin-top: 35px;
line-height: 1.2;
padding: 0 23px;
}

.slider > div .slider-left-mobile > div > div.left-info {
color: #9d9d9d;
font-size: 17px;
margin-top: 28px;
line-height: 1.2;
padding: 0 4px;
}

.slider > div .slider-left-mobile > div > div.left-location {
color: #9d9d9d;
font-size: 25px;
margin-top: 2px;
}

.slider > div .slider-left-mobile > div > div.left-read-more {
margin-top: 16px;
margin-bottom: 18px;
}

.slider > div .slider-left-mobile > div > div.left-read-more a {
color: #ec6b9c;
font-size: 22.29px;
-webkit-transition: color 0.2s ease;
-moz-transition: color 0.2s ease;
-ms-transition: color 0.2s ease;
-o-transition: color 0.2s ease;
transition: color 0.2s ease;
}

.slider > div .slider-left-mobile > div > div.left-read-more a:hover {
color: #bbe3de;
}

/*slick theme customized*/
/* Arrows */
.slick-prev,
.slick-next {
position: absolute;
display: block;
font-size: 16.5px;
cursor: pointer;
background: #ffffff;
color: #878787;
top: 50%;
margin-top: -23px;
padding: 15px 17px;
border: none;
outline: none;
z-index: 1;
-webkit-transition: color 0.2s ease;
-moz-transition: color 0.2s ease;
-ms-transition: color 0.2s ease;
-o-transition: color 0.2s ease;
transition: color 0.2s ease;
}

.slick-prev:hover,
.slick-next:hover {
outline: none;
color: #ec6b9c;
}

.slick-prev {
left: 16px;
}

@media only screen and (max-width: 1200px) {
.slick-prev {
left: 5px;
}
}

[dir="rtl"] .slick-prev {
left: auto;
right: 39px;
}

@media only screen and (max-width: 1200px) {
[dir="rtl"] .slick-prev {
right: -1px;
}
}

.slick-next {
right: 39px;
}

@media only screen and (max-width: 1200px) {
.slick-next {
right: -1px;
}
}

[dir="rtl"] .slick-next {
left: 16px;
right: auto;
}

@media only screen and (max-width: 1200px) {
[dir="rtl"] .slick-next {
left: 5px;
}
}

/* Dots */
.slick-slider {
margin-bottom: 5px;
}

.slick-dots {
position: absolute;
bottom: -45px;
list-style: none;
display: block;
text-align: center;
padding: 0;
width: 100%;
}

.slick-dots li {
position: relative;
display: inline-block;
height: 20px;
width: 20px;
margin: 0 5px;
padding: 0;
cursor: pointer;
}

.slick-dots li button {
border: 0;
background: transparent;
display: block;
height: 20px;
width: 20px;
outline: none;
line-height: 0px;
font-size: 0px;
color: transparent;
padding: 5px;
cursor: pointer;
}

.slick-dots li button:hover, .slick-dots li button:focus {
outline: none;
}

.slick-dots li button:before {
position: absolute;
top: 0;
left: 0;
width: 20px;
height: 20px;
font-size: 6px;
line-height: 20px;
text-align: center;
-webkit-font-smoothing: antialiased;
}

/*# sourceMappingURL=slick-theme.css.map */

/*slick theme customized*/
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
<!-- Latest compiled and minified CSS -->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css">

<!-- Optional theme -->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap-theme.min.css">

<!-- Latest compiled and minified JavaScript -->
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/js/bootstrap.min.js"></script>
<link href="https://cdnjs.cloudflare.com/ajax/libs/slick-carousel/1.5.7/slick.css" rel="stylesheet"/>
<script src="https://cdnjs.cloudflare.com/ajax/libs/slick-carousel/1.5.7/slick.js"></script>
<div class="container-fluid">
<div class="row slider">
<div class="col-xs-12">
<div class="col-xs-12 col-sm-3 slider-left">
<div class="col-xs-12">
<h2>PARTY DECORATIORS</h2>

<div class="col-xs-12 left-description">
LOOKING for someone to come and DECORATE your NEXT PARTY?
</div>
<div class="col-xs-12 left-info">
We will come and
<br>
decorate your children's party
<br>
within a 50 mile radius of
</div>
<div class="col-xs-12 left-location">
IPSWICH
</div>
<div class="col-xs-12 left-read-more">
<a href="#">READ MORE</a>
</div>
</div>
</div>
<div class="col-xs-12 col-sm-9 slider-main">
<div class="col-xs-12 single-slide">
<img src="https://placehold.it/350x150" alt=""/>

<div class="slide-description">
book us to decorate your next party!
<a href="#">CLICK HERE</a>
</div>
</div>
<div class="col-xs-12 single-slide">
<img src="https://placehold.it/350x150" alt=""/>

<div class="slide-description">
book us to decorate your next party!
<a href="#">CLICK HERE</a>
</div>
</div>
<div class="col-xs-12 single-slide">
<img src="https://placehold.it/350x150" alt=""/>

<div class="slide-description">
book us to decorate your next party!
<a href="#">CLICK HERE</a>
</div>
</div>
</div>
</div>
</div>
</div>

更新:最近的更新 1.5.9 解决了这个问题。

最佳答案

我遇到了同样的问题。将 slick.js 降级到旧版本 (1.3.15) 后,问题得到解决。

关于jquery - 光滑的 slider 箭头在响应模式下表现得像幻灯片,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32645386/

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