Adam Lambert
Adam Lambert

Reputation: 1421

Fancybox3 height defaulting to 9999px

I have installed Fancybox3 with NPM and imported the CSS. It is all working fine apart from when I try to open a multi-page PDF, it will default the height of the fancybox-content frame as so:

<div class="fancybox-content" style="width: 1051px; height: 9999px;">

I assume that Fancybox is trying to set the content height based on the 6 pages of PDF and it maxes out at 9999. However, with 9999px set the fancybox content is just white and no PDF is displayed (just the toolbar and PDF zoom in/out buttons). If I adjust it back to something like 100% the PDF displays correctly again.

I have tried using the fancybox options to resolve this but it does not seem to make any difference, and adding any custom CSS can fix it for PDF's but then breaks functionality for images.

Has anyone run into this before?

Upvotes: 0

Views: 765

Answers (1)

Janis
Janis

Reputation: 8769

Try disabling preloading of iframes by setting iframe: {preload: false}

Upvotes: 1

Related Questions