Support » Plugin: Easy FancyBox - WordPress Lightbox Plugin » PDF Embed with Object or Embed tag results in tiny lightbox?

  • Resolved Bjarne Oldrup

    (@oldrup)


    Hey! Not a critical issue, I’m just experimenting…

    On my test site, if I choose to open PDF’s in a lightbox, it works fine in an iframe. However, while Object or Embeds are much faster, they open the PDF in a tiny windows on the middle of the screen.

    Tested in firefox and chrome.

    Using WP 6.2, PHP 8.0, latest Easy Fancybox, version 2 mode.

    Is that something you are able to reproduce?

    Bjarne

Viewing 7 replies - 1 through 7 (of 7 total)
  • Hi Bjarne, which theme are you using on the test site? It might be some conflicting CSS…

    Thread Starter Bjarne Oldrup

    (@oldrup)

    Did some more troubleshooting:

    • Tiny box occurs in both Blocksy theme and Twenty Twenty One
    • All other plugins disabled
    • “Classic” method and “Classic Reloaded” both works fine.
    • Tiny box only occurs with fancybox v2 method.
    • I think it’s related to width: 320px in inline styling (screenshot below)

    By no means a critical issue, just curious if opening PDF’s in a lightbox would be the right user experience in some scenarios.

    Please let me know if I can provide further information on this.

    Kind regards

    Bjarne

    Hi, the only way I could reproduce this is by setting the Width to “300” and Height to “0” on Settings > Media in either the Window|Dimensions or the PDF section.

    What do you have in the Width and Height fields there?

    Also: disable inline script compression or at least exclude inline script with ID jquery-fancybox-js-after and maybe the instant click script?

    Thread Starter Bjarne Oldrup

    (@oldrup)

    Ah, that was the culprit @ravanh

    I had entered 90% and 90% in the dimensions, but percentages don’t work here – my bad 🤦‍♂️

    Instead, I experimented with fixed dimensions in pixels – now it works fine.

    As shown in the screenshot above, the height scales fine, as 1200px isn’t available on this device.

    Marking as resolved.

    Thank you for your support 👏

    Strange… % should work in the PDF width/height fields (default 90%)

    What sizes do you have in the Window|Dimensions section? And have you tried deactivating the litespeed inline script compression? I see in the page source:

    <script   id='jquery-fancybox-js-after' src="data:text/javascript;base64,dmFyIGZiX3RpbWVvdX..."

    which is not something the Easy FancyBox plugin does on its own…

    Thread Starter Bjarne Oldrup

    (@oldrup)

    Hey Ralf

    I tested with the LiteSpeed cache completely deactivated, still the same tiny results when using percentages in the size fields.

    Hovever – with a lot of experimentation I found, that leaving the fields empty results in the script adapting to the width of the PDF perfectly.

    That is in my opinion the optimal outcome, and I’m happy with the results.

    Thank you again for this fine plugin 🙏

    Thank you for the update and sharing your solution!

    I’ll keep an eye out for other/similar occurrences of this issue — % being ignored — to try and find out more.

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘PDF Embed with Object or Embed tag results in tiny lightbox?’ is closed to new replies.