如何在“prettyPhoto”中打开以下网址
网址
<a class="post-share facebook_l" href="https://www.facebook.com/sharer/sharer.php?u=$url&custom=true&width=600&height=500" data-gal="prettyPhoto[ll]" target="_blank" title="Share this page on your Facebook" onClick="ga('send', 'event', 'Likes', 'Sidebar', 'Facebook');"><span class="ic"></span><span class="likes"></span></a>
我尝试了以下方法,但无法满足我的需要
$(document).ready(function(){
$("a[data-gal^='prettyPhoto[ll]']").prettyPhoto({
custom_markup: '<div id="canvas" style="width:600px; height:500px"></div>',
changepicturecallback: function(){ }
});
});
我不知道 changepicturecallback: function(){ }
中应该包含什么才能使其正常工作。
我还可以将最后一个脚本重新制作为 window.onload
而不是 $(document).ready
吗?
最佳答案
您不必更改 jQuery 中的任何内容。您应该将 URL 更改为如下所示:
<a href="http://www.yoururl.com?iframe=true&width=100%&height=100%" rel="prettyPhoto[iframes]">Your link</a>
关于javascript - 使用 PrettyPhoto 和 jQuery 打开自定义内容,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/28658383/