试图解决我相关的 prettyPhoto 问题 here ,我尝试重新启用深层链接,希望它的社交工具 Twitter 和 Facebook 能够获取深层链接的 URL 并推文/喜欢/分享而不是画廊页面,但它没有。
此外,在加载深层链接 URL 时,例如 this在新的选项卡/窗口/浏览器/ session 中,prettyPhoto 灯箱无法加载深层链接中引用的相应图像,而是加载页面,就好像深层链接不存在一样。
我不确定深层链接共享问题是否是由于 hastag 函数的问题:function setHashtag()
in jquery.prettyPhoto.js?
任何关于解决这个深层链接问题的指导将不胜感激:-)
干杯!
最佳答案
回答:
你需要在你的主题中找到一些需要改变的东西(事实上它可能在你的案例中的文件 avia.js 中的第 466 行找到)
---1) ,social_tools:'',
---2) ,deeplinking=false,
你需要改成
,deeplinking=true,
并添加 2 个元素(iframe_markup、inline_markup),并更改 social_tools 如下所示:
所以你的新行 466 看起来像
elements.prettyPhoto({
social_tools:'<div class="pp_social"><div class="twitter"><a href="http://twitter.com/share" class="twitter-share-button" data-count="none">Tweet</a><script type="text/javascript" src="http://platform.twitter.com/widgets.js"></script></div><div class="facebook"><iframe src="http://www.facebook.com/plugins/like.php?locale=en_US&href='+location.href+'&layout=button_count&show_faces=true&width=500&action=like&font&colorscheme=light&height=23" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:500px; height:23px;" allowTransparency="true"></iframe></div></div>',
slideshow: 5000,
deeplinking: true,
overlay_gallery:false,
default_width: ww,
iframe_markup: '<iframe src ="{path}" width="{width}" height="{height}" frameborder="no"></iframe>',
inline_markup: '<div class="pp_inline">{content}</div>',
default_height: wh
});
那是推特和 Facebook 。只需以与上面相同的格式添加您想要的其他内容。尼克。
关于javascript - prettyPhoto 社交工具不共享 lightbox 深层链接,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17190154/