• Hi All,

    I recently started to use this plugin and works very nice, However there are some things that I would like to do but can’t get to those features.

    When adding a pdf link it works fine on desktop using but on mobile it creates a lightbox window but leaves it empty.

    How can this be solved?

    The page I need help with: [log in to see the link]

Viewing 6 replies - 1 through 6 (of 6 total)
  • Hi ?? the light box is not a PDF reader. It only embeds the PDF in a modal window instead of on the page itself. So it depends on the visitor device/browser if the embedded content can be displayed. In this case, PDF files are not supported by most mobile browsers.

    You can, however, integrate a PDF viewer into the light box. Start with testing the option “Embed with: Google Docs Viewer” in the PDF section on Settings > Media. This will make the light box use the Google PDF Viewer to render PDF content. This might work well on most platforms/browsers.

    Note that downsides of this viewer might be: a limited file size (very large PDF’s will not be rendered) a limited monthly use (not sure what the limit is but might cause issues on sites with a large visitor count) and generally being dependent on an external “big brother-like” provider…

    Thread Starter deancheukalam

    (@deancheukalam)

    Hi Ralf,

    Thanks for the response as it has greatly helped understanding what is going on.

    Is there someway that I can disable pdf for mobile?
    So only have that working on desktop.

    However I would still like for images to work on both mobile and desktop.

    Hi Dean, there is an option on Settings > Media to disable Fancybox for screen sizes below a certain value (in pixels). It detects screen width, not the device type per se, but you can certainly use it to disable the light box on small(er) devices.

    Thread Starter deancheukalam

    (@deancheukalam)

    I have tried this method but it also effect the pictures opening in a lightbox.

    I would only like to have the pdf disabled on small(er) devices.

    Is that possible?

    Ah ok… I see. No that is not possible with the normal settings. But you could maybe get this done with a small custom script added in a text widget. Try:

    <script>
    if ( window.innerWidth <= 720 ) {
        jQuery('a[href*=".pdf" i]').addClass('nofancybox');
    }
    </script>

    Hi Rolf,
    We are very satisfied with the plugin, but also have the same problem that only the first page of a pdf is displayed on iphone. With android and PC, there are no problems. The option to change “iframe” to “google docs viewer” in settings causes the PC user to have to wait a long time to load the pdf (as you indicate). Is there a solution (update) on the horizon ?

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Fancybox PDF not opening on mobile’ is closed to new replies.