【问题标题】:Opening custom content using prettyPhoto and jQuery使用 prettyPhoto 和 jQuery 打开自定义内容
【发布时间】:2015-04-23 20:49:21
【问题描述】:

如何在“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

【问题讨论】:

    标签: javascript jquery prettyphoto


    【解决方案1】:

    您不必在 jQuery 中进行任何更改。你应该把你的 URL 改成这样:

    <a href="http://www.yoururl.com?iframe=true&width=100%&height=100%" rel="prettyPhoto[iframes]">Your link</a>
    

    【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2015-05-31
    相关资源
    最近更新 更多