• Resolved yelloworange

    (@yelloworange)


    Hi there!

    I am using ajax to load most of the content of my site (zajax pro) – and seem to need to reload the core js off visual portfolio after each ajax content refresh. There is some wonkiness of VP layouts when I do not do a full refresh. There is a native option in Zajax for reload of a different Masonry plugin’s js – so I am assuming I will need to handle VP the same way.

    Which files would you recommend I reload? Also, I may possibly be getting a minor conflict with GSAP/scrollmagic. Do you include these anywhere in your code?

    Thank you
    Caitlin

    • This topic was modified 6 years, 8 months ago by yelloworange.
    • This topic was modified 6 years, 8 months ago by yelloworange.
Viewing 12 replies - 1 through 12 (of 12 total)
  • Thread Starter yelloworange

    (@yelloworange)

    NVM – I think I may have solved this on my own. Sorry about that!

    Plugin Author Nikita

    (@nko)

    Hi Caitlin.

    I’m glad that you resolved this, but I think this may be helpful for other users. Soon plugin will be updated and added a new FAQ section. There will be a list of some available jQuery methods. So, you can destroy and initialize portfolio after your AJAX page loaded.

    Example:

    // Initialize.
    $( '.vp-portfolio' ).vpf();
    
    // Destroy.
    $( '.vp-portfolio' ).vpf( 'destroy' );
    

    Regards, nK.

    Thread Starter yelloworange

    (@yelloworange)

    Thank you!!! This is great!!!

    Thread Starter yelloworange

    (@yelloworange)

    Hey @nko – I am still having some trouble with this. Can I please ask to employ your help, formally? Thank you – C

    Thread Starter yelloworange

    (@yelloworange)

    PS: reachable at [email protected]

    Plugin Author Nikita

    (@nko)

    Hi @yelloworange.

    I found some bugs with custom jQuery Events triggering, fixed in 1.7.2.

    If you tried to use it and no success, please, try again with the new version.

    We are not doing custom work, so, I’m not sure I will help with custom code. I only may help if there is a bug in the plugin code.

    Thread Starter yelloworange

    (@yelloworange)

    Hey nK – I hope this finds you well.

    I think i may have figured out (a friend helped quite a bit with this effort) what is wrong but do not know how to fix it. When using ajax, the initialize and destroy methods seem to work – but if two portfolios are of different types (ie: masonry and tiles), the correct css files do not load along with the ajax calls. I believe this is the problem I am experiencing- which I think you would be able to confirm by visiting the site – caitlineverett.com.

    Thank you

    C

    • This reply was modified 6 years, 4 months ago by yelloworange.
    Thread Starter yelloworange

    (@yelloworange)

    PSS: To confirm that this is the case, I made a test post here: https://caitlineverett.com/testpost/ – if you switch between the homepage and this page, the portfolios both work — so the issue is not that the jquery init/destroy methods do not work, but that switching between portfolio types does not seem to work (probably css related).

    Plugin Author Nikita

    (@nko)

    You also need to load new styles from on the new page.

    For example on this page https://caitlineverett.com/blog/ portfolio adds styles:

    And when you load the page using AJAX, you ignore these styles.

    Thread Starter yelloworange

    (@yelloworange)

    Hey nK! Thank you for looking. I am not sure what is the best way to accomplish this. Do you have any recommendations?

    Thread Starter yelloworange

    (@yelloworange)

    PS: was looking at this

    if( ! jQuery('#visual-portfolio-items-style-fly-css').length )         // fly stylesheet
    {
        jQuery('head').append('<link rel="stylesheet" type="text/css" href="https://www.caitlineverett.com/wp-content/plugins/visual-portfolio/templates/items-list/items-style/fly/style.css">');
    console.log("added fly stylesheet");
    }

    but it does not seem to work, exactly… id be happy to help with a plugin update if you have a strategy that you think would work best

    Thread Starter yelloworange

    (@yelloworange)

    PSS: Enqueing them permanently works!! This is great news!! I wonder if there is a way to enqueue and de-queue w/ajax or the likes. Sorry to send you so many of these and thank you!

Viewing 12 replies - 1 through 12 (of 12 total)
  • The topic ‘Core JS File’ is closed to new replies.