【发布时间】:2018-06-12 13:52:14
【问题描述】:
我想在带有按钮或链接的灯箱中打开默认的 Wordpress 画廊,并在页面上隐藏画廊缩略图。我怎样才能做到这一点?
图库短代码:[gallery ids="55,67"]
提前致谢。
【问题讨论】:
标签: wordpress button hyperlink gallery lightbox
我想在带有按钮或链接的灯箱中打开默认的 Wordpress 画廊,并在页面上隐藏画廊缩略图。我怎样才能做到这一点?
图库短代码:[gallery ids="55,67"]
提前致谢。
【问题讨论】:
标签: wordpress button hyperlink gallery lightbox
你可以这样试试。
<style>
.hiddengallery{
display:none;
}
</style>
<button class="showgallery" >click here</button>
<div class="hiddengallery">
// add lightbox code here
<?php echo do_shortcode('[gallery ids="55,67"]');?>
</div>
<script>
jQuery(document).on("click",".showgallery", function (){
jQuery(".hiddengallery").show();
});
</script>
【讨论】:
jQuery(".gallery-item:first-of-type > .gallery-icon > a").trigger("click");