我有一个棘手的情况。我有动态填充的内容,我想在Bootstrap 3轮播中进行布局。捕获的是,在动态字符串中,只有3/4的内容应该放在旋转木马中。这是一个简短的例子
<?php if ($imagePosition == 'left'): ?>
<div class="hero-item item no-carousel">
Conent I don't want to be shown on the carousel
</div>
<div class="hero-item item show">
I want this to be shown in the carousel
</div>
<?php elseif ($imagePosition == "background"): ?>
<div class="hero-item item show">
I want this to be shown in the carousel
</div>
<?php elseif ($imagePosition == "right"): ?>
<div class="hero-item item show">
I want this to be shown in the carousel
</div>
<div class="hero-item item no-carousel">
Conent I don't want to be shown on the carousel
</div>
<?php endif; ?>
所以输出可能是
<div class="hero-item item no-carousel">Content I don't want to be shown on the carousel</div>
<div class="hero-item item show">I want this to be shown in the carousel</div>
<div class="hero-item item show">I want this to be shown in the carousel</div>
<div class="hero-item item no-carousel">Conent I don't want to be shown on the carousel</div>
如何让Bootstrap轮播只显示我想要展示的项目,例如,那些带有课程的&#39;显示&#39;?