Galleria:包含未显示链接的图层
我正在使用 galleria jquery 插件 1.2.5 中引入的全新 HTML 层功能。它工作得很好,但是一旦有一个 标记中的标签,根本没有显示任何层。这是我的标记:
<div id="galleria">
<a href="feature-image.jpg" class="link">
<img title="feature" alt="" src="feature-thumbnail.jpg" class="image" />
<div class="layer">
<h3>subtitle</h3>
<h2>title</h2>
<p>lorem ipsum dolor sit amet</p>
<p><a href="http://www.example.com">read more...</a></p>
</div>
</a>
</div>
JavaScript:
$('#galleria').galleria({
dataConfig: function(img) {
return {
layer: $(img).siblings('.layer').html()
};
}
});
有人有想法吗?提前致谢!
I'm using the all new HTML layer feature introduced in 1.2.5 of the galleria jquery plugin. It works just fine but as soon as there is an <a> tag in the markup, no layer at all is being displayed. Here's my markup:
<div id="galleria">
<a href="feature-image.jpg" class="link">
<img title="feature" alt="" src="feature-thumbnail.jpg" class="image" />
<div class="layer">
<h3>subtitle</h3>
<h2>title</h2>
<p>lorem ipsum dolor sit amet</p>
<p><a href="http://www.example.com">read more...</a></p>
</div>
</a>
</div>
And the JavaScript:
$('#galleria').galleria({
dataConfig: function(img) {
return {
layer: $(img).siblings('.layer').html()
};
}
});
Anyone having an idea? Thanks in advance!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
嗯,我的猜测是它没有按预期工作,因为 div
.layer
位于 内部。它不应该的元素。尝试将您的 html 重新排序为:然后您的画廊代码将是:
Hmm, my guess is that it's not working as expected because the div
.layer
is inside <a> element which it shouldn't. Try to reorder your html to this:And then your galleria code would be: