gpt4 book ai didi

javascript - 在 Magnific Popup 中打开所有图片,而不仅仅是发布图片

转载 作者:行者123 更新时间:2023-11-28 06:11:38 25 4
gpt4 key购买 nike

我想知道如何让 Magnific Popup 处理所有图像,而不仅仅是发布图像。我特别希望它也能处理侧边栏中的图像。

这是我在 Blogger 博客的页脚小部件中使用的代码:

<link type='text/css' rel='stylesheet' href='https://cdnjs.cloudflare.com/ajax/libs/magnific-popup.js/1.0.0/magnific-popup.min.css' />
<script src='https://cdnjs.cloudflare.com/ajax/libs/magnific-popup.js/1.0.0/jquery.magnific-popup.min.js' type='text/javascript'></script>
<script>
//<![CDATA[
$('.post-entry').magnificPopup({
delegate:'a[imageanchor="1"]',
gallery: {
enabled: true
},
type: 'image'
});
//]]>
</script>

如果我将它直接插入到博客的模板中,它会应用于所有图像吗?如果有,在哪里?

您可能已经注意到我在这方面并不出色?我知道这可能是一些基本的东西,但它仍然超出了我的范围。如果有人能给我任何帮助,我将不胜感激。

最佳答案

You can add all the images in one div and call that div class in your javascript function 

<div class="popup-gallery">
<a href="placeholder"><img src="" width="75" height="75"></a>
<a href="placeholder"><img src="" width="75" height="75"></a>
<a href="placeholder"><img src="" width="75" height="75"></a>
<a href="placeholder"><img src="" width="75" height="75"></a>
</div>

Web Reference: http://dimsemenov.com/plugins/magnific-popup/

Or you can use FancyBox which is open source and easy to use

关于javascript - 在 Magnific Popup 中打开所有图片,而不仅仅是发布图片,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36138378/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com