我正在尝试在Bootstrap 4 Alpha 6中创建一个垂直方向的旋转木马.我仍然无法弄清楚为什么Bootstrap的人不包括这个方向,但我接近我的解决方案拥有.我似乎在我的CSS中遗漏了一些东西,但似乎无法放置它.
在JSFIDDLE上查看我的演示
我的问题是旋转木马滑梯的非向上流体运动.幻灯片从底部上升,但在结束时不再继续 - 相反消失.
我正在构建这个代码来编译使用BS3执行此操作的旧方法,并尝试尽可能地匹配新的CSS类.这是我的代码,任何帮助解决这个谜团将非常感激.
HTML
<!-- Bootstrap Carousel -->
<div id="testCarousel" class="carousel slide vertical" data-ride="carousel">
<ol class="carousel-indicators">
<li data-target="#testCarousel" data-slide-to="0" class="active"></li>
<li data-target="#testCarousel" data-slide-to="1"></li>
<li data-target="#testCarousel" data-slide-to="2"></li>
</ol>
<div class="carousel-inner" role="listbox">
<div class="carousel-item active">
<img class="d-block img-fluid" src="//placehold.it/2500x750" alt="First slide">
</div>
<div class="carousel-item">
<img class="d-block img-fluid" src="//placehold.it/2500x750" alt="Second slide">
</div>
<div class="carousel-item">
<img class="d-block img-fluid" src="//placehold.it/2500x750" alt="Third slide">
</div>
</div>
</div>
Run Code Online (Sandbox Code Playgroud)
CSS
/* Just for Example Purposes */
body {
background: #333
} …Run Code Online (Sandbox Code Playgroud) css twitter-bootstrap twitter-bootstrap-4 bootstrap-carousel bootstrap-4
首先,我非常了解CSS媒体查询.我的问题是:当你将div类堆叠在一个div中时; 例:
<div class="class1 class2"></div>
Run Code Online (Sandbox Code Playgroud)
并且你想删除"class2"@media(max-width:768px)创建输出:
<div class="class1"></div>
Run Code Online (Sandbox Code Playgroud)
...一旦达到768px阈值.
到目前为止,除了这个非功能性代码之外我还没有提出任何其他内容:
<script>
jQuery(document).resize(function () {
var screen = $(window)
if (screen.width < 768) {
$(".class2").hide();
}
else {
$(".class2").show();
}
});
</script>
Run Code Online (Sandbox Code Playgroud)
我真的很难找到适用于此的答案.我不想阻止整个div的内容!只需删除两个类中的一个.