PDF not shown untill resize

QuestionsCategory: PDF Light ViewerPDF not shown untill resize
Marvin asked 5 years ago
I added a PDF to a page and that PDF was converted without problem. However on the page it only shows the bottom navigation (without thumbs) and not the PDF itself. Strangely enough when I resize my browser it does show everything correctly.
Any thoughts what causes this?
support
replied 5 years ago

Hello Marvin, for now cannot say nothing certain. Could you please share some demo url so I can test the issue by myself? Thank you in advance

Marvin
replied 5 years ago

I have a reply to this private topic: https://support.wp.teamlead.pw/q/reply-to-previous/#comment-129 but that is not accessible to me. Since it’s regarding the same topic, can you paste that answer here?

2 Answers

Best Answer

support answered 5 years ago
Hello Marvin,
I’ve tested your theme code. I see you use jquery fadeIn effect to show the body after javascript code is loaded. This is not a problem, but we will need to recalculate sizes of the viewer right after it became visible.
For this we will provide javascript function called PDFLightViewerApp.triggerRecalculateAllSizes() in the version 1.3.14 (will be released today), so you could run it just after your page is loaded.
After update to 1.3.14 you’ll need to change your code on line 126 in the file https://horeko.nl/wp-content/themes/horeko/js/script.min.js to the following code:

 jQuery("body").fadeIn(500, function() {
PDFLightViewerApp.triggerRecalculateAllSizes();
})

 

Marvin answered 5 years ago
It works, thanks!!
support
replied 5 years ago

Thank you for letting me know. If you’ll have any other questions please do not hesitate to ask us.