javascript - 如何从 Slick Slider 中删除类?
问题描述
我一直在尝试使用光滑的滑块,但遇到了一个小问题。我有两个部分要使用滑块。第一个只是一张图片的“淡入淡出”效果,第二个是推荐滑块。现在的问题是,如果我想在我的推荐信之间留出一点余地,我会使用:
.slick-slide {
margin: 0px 10px;
}
HTML 标记 -
<div class="slider">
<div class="testimonial-container">
<div class="testimonial-img">
<img src="images/face.jpg" alt="face">
</div>
<div class="testimonial-text">
<h3>This is the only Norskkurs to take in Stavanger if value for
money and truly progressing with
the Norwegian are important factors for you.
</h3>
<strong>Jessica Morris</strong>
<p>A1/A2 Student</p>
</div>
</div>
<div class="testimonial-container">
<div class="testimonial-img">
<img src="images/face.jpg" alt="face">
</div>
<div class="testimonial-text">
<h3>Very hands on and animated. Relaxed atmosphere which is
perfect for feeling comfortable in a new language setting.
</h3>
<strong>Helen Brian</strong>
<p>A2 Student</p>
</div>
</div>
<div class="testimonial-container">
<div class="testimonial-img">
<img src="images/face.jpg" alt="face">
</div>
<div class="testimonial-text">
<h3>This course is a wonderful journey with lots of fun and
activities towards the goal. It's a well
designed course for learning.
</h3>
<strong>Chidabaram Harikumar</strong>
<p>A1/A2/B1 Student</p>
</div>
</div>
<div class="testimonial-container">
<div class="testimonial-img">
<img src="images/face.jpg" alt="face">
</div>
<div class="testimonial-text">
<h3>It is first language course which I have lasted more than one month :) . It means alot to me. They
teach with both their heart and brain.
</h3>
<strong>Amir Ghaderian</strong>
<p>A2/B1 Student</p>
</div>
</div>
<div class="testimonial-container">
<div class="testimonial-img">
<img src="images/face.jpg" alt="face">
</div>
<div class="testimonial-text">
<h3>One of the best thing which I have done in my life is to join Norskkurs in LNS.It's a great place to
learn the language with good people.
</h3>
<strong>Dayanand Mohanasundram</strong>
<p>A1/A2 Student</p>
</div>
</div>
</div>
现在我的下一张“淡入淡出”幻灯片我不想要边距,但它仍然会为我使用的所有幻灯片添加相同的 .slick-slide 属性。
无论如何我只能将其应用于一张幻灯片或从其他幻灯片中删除此类/属性吗?
简而言之,我只需要推荐幻灯片之间的边距,而不需要另一张。我怎样才能解决这个问题?
解决方案
您可以将类推荐添加到推荐滑块并为此类添加边距。
.testimonial-slide {
margin: 0px 10px;
}
推荐阅读
- compilation - 显示先前编译的 Clion 控制台
- javascript - 异步等待在 express.js 中没有响应 mysql.js
- go - 使用 revel 和 dep 进行依赖管理
- html - 背景图像:保留浏览器窗口的纵横比
- android - 两个并排的线性布局,一个具有最小宽度
- c# - 使用公钥的 RSA 加密
- spring-integration - 安慰和消息驱动的通道适配器
- javascript - PeerConnection 无法创建答案
- java - 调用后退出方法,但方法应继续处理 JAVA 中提交的请求
- android - 我无法使用 Endless RecyclerView ScrollListener 加载更多页面