【发布时间】:2019-10-24 10:26:43
【问题描述】:
我一直在测试我的代码并遇到了一个小问题。我在底部的指示器允许导航,但要到达轮播中的最终图像,我需要单击倒数第二个指示器?我看不到错误:(。其他所有工作正常。
<div id="carouselExampleIndicators" class="carousel slide" data-ride="carousel">
<ul class="carousel-indicators">
{% for item in page.blogpage_images.all %}
<li data-target="#carouselExampleIndicators" data-slide-to="{{ forloop.counter }}"
class="{% if forloop.counter == 1 %}active{% endif %}"></li>
{% endfor %}
</ul>
<div class="carousel-inner">
{% for item in page.blogpage_images.all %}
{% image item.image fill-900x400 as img %}
<div class="carousel-item {% if forloop.counter == 1 %}active{% endif %}">
<img src="{{ img.url }}" class="d-block w-100" alt="{{ img.alt }}">
</div>
{% endfor %}
</div>
</div>
编辑:我得到了答案,但删除问题没有意义!
【问题讨论】:
标签: python html django wagtail