Fancybox画廊循环问题 [英] Fancybox gallery loop issue
本文介绍了Fancybox画廊循环问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我对一个 fancybox
画廊的代码有问题,当您单击该画廊时,它会显示整个页面上的所有图像,何时应该只显示第一个图像,然后显示其他图像.
I have a problem with this code for a fancybox
gallery which its showing all images across the page, when should be visible just the first one and then others, when you click.
如何在单击之前停止显示所有图像并仅显示第一个图像?
How do i stop from showing all images and show just the first one before click?
<code>
{% for slide in wp.get_post_meta(post.ID, '_property_slides', TRUE) %}
<div class="carousel property">
<div class="preview">
<a rel="galeria{{ post.ID }}" href="{{ slide.imgurl }}">
<img src="{{ slide.imgurl }}" alt="">
</a>
</div>
<!-- /.preview -->
<div class="content">
<ul>
{% for slide in wp.get_post_meta(post.ID, '_property_slides', TRUE) %}
{% if loop.first %}
<li class="active" >
{% else %}
<li>
{% endif %}
<img src="{{ slide.imgurl }}" alt="">
</li>
{% endfor %}
</ul>
<a id="carousel-prev" href="#">{{ wp.__('Previous', 'aviators') }}</a>
<a id="carousel-next" href="#">{{ wp.__('Next', 'aviators') }}</a>
</div>
<!-- /.content -->
</div><!-- /.carousel -->
{% endfor %}
</code>
推荐答案
您必须更改第一行:
// delete this line {% for slide in wp.get_post_meta(post.ID, '_property_slides', TRUE) %}
{% if wp.get_post_meta(post.ID, '_property_slides', TRUE) %} //use this one
最后一个:
// delete this line {% endfor %}
{% end %}
这篇关于Fancybox画廊循环问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文