【发布时间】:2022-01-08 18:38:13
【问题描述】:
我目前正在尝试在猫头鹰旋转木马的中心放置一个小图像。我确实弄清楚了,当它处于活动状态并位于中心时如何做,但是当项目不再使用类中心定义时它不起作用。
这是我使用的 Owlcarousel 的链接:https://github.com/OwlCarousel2/OwlCarousel2/releases
这是网站上 HTML 的屏幕截图 (F12)
我的 HTML 代码:
<section class="wrapper_bewertungen">
<div class="bewertungen_wrap">
<h2>Das sagen unsere Kunden</h2>
<div id="testimonial-slider" class="owl-carousel">
<div class="testimonial">
<div class="testimonial-content">
<div class="Picture"><img src="static\img\Partypeople\Man1.png" alt="Man1" width="50" height="274"></div>
</div>
<h3 class="title">Mike<span> - Umkreis Köln</span></h3>
</div>
<div class="testimonial">
<div class="testimonial-content">
<p class="description">
So einfach sollte ein Autoverkauf immer ablaufen.
</p>
</div>
<h3 class="title">Sophia<span> - Umkreis Bielfeld</span></h3>
</div>
<div class="testimonial">
<div class="testimonial-content">
<p class="description">
Vielen Dank für den tollen Service, ich empfehle Sie auf jeden Fall weiter!
</p>
</div>
<h3 class="title">Thorsten<span> - Umkreis Bayern</span></h3>
</div>
<div class="testimonial">
<div class="testimonial-content">
<p class="description">
Hat schnell und Problemlos geklappt, gerne wieder.
</p>
</div>
<h3 class="title">Markus<span> - Umkreis Hamburg</span></h3>
</div>
<div class="testimonial">
<div class="testimonial-content">
<p class="description">
Genau die richtigen Gefunden um mein Auto zu verkaufen.
</p>
</div>
<h3 class="title">Meryem<span> - Umkreis Bonn</span></h3>
</div>
<div class="testimonial">
<div class="testimonial-content">
<p class="description">
Ohne großen Zeitaufwand mein Auto verkauft. Super
</p>
</div>
<h3 class="title">Jonas<span> - Umkreis Aachen</span></h3>
</div>
</div>
</div>
</section>
我的 SCSS 代码:
.owl-carousel {
.owl-item {
img {
height: 80px;
width: auto !important;
border-radius: 20px;
border: 1px solid black;
filter: drop-shadow(5px 5px 2px #a0a0a0);
}
}
}
.wrapper_bewertungen {
height: 400px;
h2 {
display: flex;
justify-content: center;
align-items: center;
padding-bottom: 30px;
}
.bewertungen_wrap {
width: calc(100% - 20px);
max-width: 1100px;
margin: 0 auto;
.center {
transform: scale(1.1);
.testimonial {
transition: all 1s;
padding: 20px 20px 10px;
background-color: white;
color: rgb(0, 0, 0);
border: 6px solid $primary-color;
margin: 20px;
.title {
padding-top: 10px;
border-top: 3px solid #fff;
span {
font-size: 15px;
}
}
.active {
.Picture {
display: flex !important;
justify-content: center !important;
img {
height: 60px;
width: auto;
}
}
}
.Picture {
display: flex;
justify-content: center;
img {
height: 80px;
width: auto;
border-radius: 20px;
border: 1px solid black;
filter: drop-shadow(5px 5px 2px #a0a0a0);
}
}
}
}
}
}
猫头鹰轮播设置:
$("#testimonial-slider").owlCarousel({
items: 1,
loop: true,
autoplay: false,
dots: false,
center: true,
responsiveClass: true,
responsive: {
700: {
items: 3,
autoplay: true,
autoplayTimeout: 5000,
smartSpeed: 1000
}
},
});
【问题讨论】:
标签: javascript html css sass owl-carousel