我尝试用blueimp图库显示一些图片,但我有一点问题:微缩模型正确加载但是当我点击它时,我被重定向到这张图片的页面并且没有显示
这是我在twig文件中的代码(不要注意imag_filter,它只是为了调整图片大小):
<div class="row">
<div id="show-img">
<div id="blueimp-gallery" class="blueimp-gallery blueimp-gallery-carousel blueimp-gallery-controls">
<div class="slides"></div>
<a class="prev">‹</a>
<a class="next">›</a>
</div>
</div>
</div>
{% if question.images|length > 0 %}
<div id="gallery">
<hr>
{% for image in question.images %}
<a href="{{ image.path|imagine_filter('sylius_extra_large') }}" title="{{image.altTag}}" data-gallery>
<img class="img-rounded" src="{{ image.path|imagine_filter('sylius_small') }}" alt="{{ image.alttag }}" />
</a>
{% endfor %}
</div>
<script>
document.addEventListener("DOMContentLoaded", init, false);
function init() {
blueimp.Gallery(
document.getElementById('gallery').getElementsByTagName('a'),
{
container: '#blueimp-gallery',
carousel: false,
disableScroll: false,
hidePageScrollbars: false
}
);
};
</script>
{% endif %}
我错过了什么吗? 提前感谢您的帮助