PDF in a lightbox

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #10045617
    cosmo
    Participant

    I have added a link which opens a lightbox with a youtube video.

    Youtube

    This works fine.

    Now I want to open a pdf file in a lightbox on the same page with

    PDF

    but it opens in a new tab. How can I make this work?


    #10045618
    cosmo
    Participant

    I can’t post code examples here.

    a href="https://www.youtube.com/embed/Lxjm1BNLXA?rel=0&mute=1&autoplay=0" target="_blank" class="btn btn-primary w-100 mt-1 mb-1 me-1 popup-youtube btn-modern" rel="noreferrer" Youtube closing a tag here

    This works fine.

    Now I want to open a pdf file in a lightbox on the same page with

    a-tag here class="simple-ajax-popup btn btn-modern btn-primary mb-4" href="/pdf/test.pdf" PDF closing a tag here

    but it opens in a new tab. How can I make this work?


    #10045619
    Support
    Keymaster

    Hello, you can find an example of that in this link:
    https://stackoverflow.com/questions/23908125/can-we-use-magnific-popup-plugin-to-view-pdf-files

    But it will not work in all browsers (and depends on user settings): https://github.com/dimsemenov/Magnific-Popup/issues/695

    We don’t have an example of that on Porto but this may help: https://mozilla.github.io/pdf.js/

    Kind Regards.


Viewing 3 posts - 1 through 3 (of 3 total)

This topic is marked as "RESOLVED" and can not rceive new replies.