javascriptjqueryprettyphoto

Opening custom content using prettyPhoto and jQuery


How to open the following url in “prettyPhoto”

URL

<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>

I have tried the following, but cannot adopt it for what I need

$(document).ready(function(){
                    $("a[data-gal^='prettyPhoto[ll]']").prettyPhoto({
                        custom_markup: '<div id="canvas" style="width:600px; height:500px"></div>',
                        changepicturecallback: function(){ }
                    });
                });

I do not know what should I have in the changepicturecallback: function(){ } to make it work.

Also can I remake the last script to be in window.onload instead of $(document).ready?


Solution

  • You don't have to change anything in jQuery. You should change your URL to something like this:

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