Support » Plugin: DearFlip - WordPress 3D Flipbook, PDF Flipbook » Loading Issue with Barba.js

  • Resolved njaffe3

    (@njaffe3)


    I’m having a pretty specific issue getting my embedded pdf to load on the page below. The first time I go to the page, it loads correctly. But if I click on “work” in the top menu, refresh the page, and then click on “social distancezine,” I get a grey box with a “DearFlip: Loading …” message. I’m using barba.js on my site to create page transitions. I’m reloading all the necessary scripts for Dearflip to work (dflip.min.js, pdf.min.js, mockup.min.js, and three.min.js). However it seems like it can’t access the variable options that are set by the plugin, including the pdf source. Can you let me know if there is a way to fix this? Thanks!

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

Viewing 6 replies - 16 through 21 (of 21 total)
  • Plugin Author deip

    (@deip)

    Hi,
    Added a class to it :
    df-shortcode-script

    Please find it on v 1.7.3.8

    Best,
    Deip

    Thanks so much for all your help! I really appreciate it! I’m still getting the same error after adding

    barba.hooks.after((data) => {
        let js = document.querySelectorAll('script.df-shortcode-script');
        if(js != null){
             js.forEach((item) => {
                 eval(item.innerHTML);
             });
        }
    });

    So I’m not sure what else to try. It may just be that the two are not compatible. Or more likely my lack of understanding about exactly how they both work…

    Plugin Author deip

    (@deip)

    Just remove the older fix.
    if(window.DFLIP && DFLIP.parseBooks){DFLIP.parseBooks();}
    That is running earlier than this and causing early execution without the required variable.

    It works! Thank you so much! I also needed to add “next” so the barba code looks like this:

    barba.hooks.enter(({next}) => {
        let js = document.querySelectorAll('script.df-shortcode-script');
        if(js != null){
             js.forEach((item) => {
                 eval(item.innerHTML);
             });
        }
    });

    Wish there was a way without eval, but seems like that can’t be helped for now.

    Really appreciate all you help! This issue has been driving me crazy for a while now. Thanks again!

    Plugin Author deip

    (@deip)

    That’s great news!

    Yeah, eval is not the best solution, but could not be helped.

    Have a good day,
    Deip

    P.S. When you have free time, feel free to leave us a review. It will mean a lot to us and help our plugin grow further 🙂

    • This reply was modified 1 month, 1 week ago by deip.
    • This reply was modified 1 month, 1 week ago by deip.

    Thanks so much again! Just left a review 🙂

    Have a great day!

Viewing 6 replies - 16 through 21 (of 21 total)
  • You must be logged in to reply to this topic.