• Resolved morph3us

    (@morph3us)


    I have an isotope gallery, which shows the hero image of the last posts.
    When clicking on one of the images, I want to show the corresponding article in a lightbox.

    I found a code snippet somewhere here on this forum which works:
    $(‘.isotope-item-link’).fancybox({type: ‘iframe’});

    However, now the header and footer of the article are shown aswell, which I do not want to happen.
    So I tried to add “class=”fancybox-hide” to the appropriate divs, but now they are also hidden on the main page.

    Is there any way to filter which divs of the linked content are shown inside of the lightbox?

    I tried to hide them via CSS, but as its shown as an iframe, I dont have access from the outside.

    Thank you very much in advance!

    • This topic was modified 2 years, 9 months ago by morph3us.
Viewing 1 replies (of 1 total)
  • Plugin Author arisoft

    (@arisoft)

    Hi

    Try to add the following code to “ARI Fancy Lightbox -> Settings -> Advanced -> Custom JS code” parameter:

    $(document).on('afterLoad.fb', function(e, instance, current, firstRun) {
      if (current.contentType === 'iframe') {
           try {
             var doc = current.$iframe.contents().get(0);
             var link = doc.createElement('style');
             link.type = 'text/css';
             link.innerHTML = '.fancybox-hide {display:none}';
             doc.head.appendChild(link);
           } catch (ex) { console.log(ex); }
      }
    });
Viewing 1 replies (of 1 total)
  • The topic ‘Show only parts of linked page?’ is closed to new replies.