【发布时间】:2017-12-28 00:28:39
【问题描述】:
我尝试将 Slick 与我的 Bootstrap 4 网站集成,但这让我很难过。我的目标是从缩略图中定位我的文本。 不知何故,它在缩略图下方移动。知道为什么吗?
HTML
<div class="row">
<div class="col-12 tb-items">
<div class="row tb__item">
<div class="col-5">
<img class="tb__thumbnail" src="{% static "img/placeholders/fb.jpg" %}">
</div>
<div class="col-7">
<a href="#">Book</a>
<h3><a href="#">1 The Everlast Notebook</a></h3>
<p>One smart, reusable notebook to last the rest of your life? That's not magic, that's the Everlast.</p>
<p>by <a href="#">Andrew Noah</a></p>
<div class="tb__votes">
<b>123123123</b><br>votes
</div>
<div class="tb__date-created">
<b>23</b><br>days ago
</div>
</div>
</div>
<div class="row tb__item">
<div class="col-5">
<img class="tb__thumbnail" src="{% static "img/placeholders/fb.jpg" %}">
</div>
<div class="col-7">
<a href="#">Book</a>
<h3><a href="#">1 The Everlast Notebook</a></h3>
<p>One smart, reusable notebook to last the rest of your life? That's not magic, that's the Everlast.</p>
<p>by <a href="#">Andrew Noah</a></p>
<div class="tb__votes">
<b>123123123</b><br>votes
</div>
<div class="tb__date-created">
<b>23</b><br>days ago
</div>
</div>
</div>
</div>
</div>
CSS
.tb__thumbnail {
width: 100%;
}
JAVASCRIPT
$(function () {
$('.tb-items').slick({
arrows: false,
})
$('.tb__topic').click(function () {
$('.tb-items').slick('slickNext')
}
)
})
【问题讨论】:
-
你确定你没有任何其他的 CSS 或 Div 包装这个吗?我觉得没问题codepen.io/anon/pen/VypvRL
-
别担心,现在就看。一会儿
标签: javascript html css twitter-bootstrap slick.js