Title: Core JS File
Last modified: July 9, 2018

---

# Core JS File

 *  Resolved [yelloworange](https://wordpress.org/support/users/yelloworange/)
 * (@yelloworange)
 * [7 years, 9 months ago](https://wordpress.org/support/topic/core-js-file/)
 * 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 7 years, 9 months ago by [yelloworange](https://wordpress.org/support/users/yelloworange/).
    -  This topic was modified 7 years, 9 months ago by [yelloworange](https://wordpress.org/support/users/yelloworange/).

Viewing 12 replies - 1 through 12 (of 12 total)

 *  Thread Starter [yelloworange](https://wordpress.org/support/users/yelloworange/)
 * (@yelloworange)
 * [7 years, 9 months ago](https://wordpress.org/support/topic/core-js-file/#post-10478363)
 * NVM – I think I may have solved this on my own. Sorry about that!
 *  Plugin Author [nK](https://wordpress.org/support/users/nko/)
 * (@nko)
 * [7 years, 9 months ago](https://wordpress.org/support/topic/core-js-file/#post-10488634)
 * 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](https://wordpress.org/support/users/yelloworange/)
 * (@yelloworange)
 * [7 years, 9 months ago](https://wordpress.org/support/topic/core-js-file/#post-10488783)
 * Thank you!!! This is great!!!
 *  Thread Starter [yelloworange](https://wordpress.org/support/users/yelloworange/)
 * (@yelloworange)
 * [7 years, 7 months ago](https://wordpress.org/support/topic/core-js-file/#post-10661463)
 * Hey [@nko](https://wordpress.org/support/users/nko/) – I am still having some
   trouble with this. Can I please ask to employ your help, formally? Thank you –
   C
 *  Thread Starter [yelloworange](https://wordpress.org/support/users/yelloworange/)
 * (@yelloworange)
 * [7 years, 7 months ago](https://wordpress.org/support/topic/core-js-file/#post-10665545)
 * PS: reachable at [Caitlineverett@gmail.com](https://wordpress.org/support/topic/core-js-file/Caitlineverett@gmail.com?output_format=md)
 *  Plugin Author [nK](https://wordpress.org/support/users/nko/)
 * (@nko)
 * [7 years, 7 months ago](https://wordpress.org/support/topic/core-js-file/#post-10671725)
 * Hi [@yelloworange](https://wordpress.org/support/users/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](https://wordpress.org/support/users/yelloworange/)
 * (@yelloworange)
 * [7 years, 5 months ago](https://wordpress.org/support/topic/core-js-file/#post-10845632)
 * 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 7 years, 5 months ago by [yelloworange](https://wordpress.org/support/users/yelloworange/).
 *  Thread Starter [yelloworange](https://wordpress.org/support/users/yelloworange/)
 * (@yelloworange)
 * [7 years, 5 months ago](https://wordpress.org/support/topic/core-js-file/#post-10845648)
 * PSS: To confirm that this is the case, I made a test post here: [http://caitlineverett.com/testpost/](http://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 [nK](https://wordpress.org/support/users/nko/)
 * (@nko)
 * [7 years, 5 months ago](https://wordpress.org/support/topic/core-js-file/#post-10846172)
 * You also need to load new styles from on the new page.
 * For example on this page [http://caitlineverett.com/blog/](http://caitlineverett.com/blog/)
   portfolio adds styles:
 * [[
 * And when you load the page using AJAX, you ignore these styles.
 *  Thread Starter [yelloworange](https://wordpress.org/support/users/yelloworange/)
 * (@yelloworange)
 * [7 years, 5 months ago](https://wordpress.org/support/topic/core-js-file/#post-10847405)
 * 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](https://wordpress.org/support/users/yelloworange/)
 * (@yelloworange)
 * [7 years, 5 months ago](https://wordpress.org/support/topic/core-js-file/#post-10847414)
 * 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="http://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](https://wordpress.org/support/users/yelloworange/)
 * (@yelloworange)
 * [7 years, 5 months ago](https://wordpress.org/support/topic/core-js-file/#post-10847423)
 * 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.

 * ![](https://ps.w.org/visual-portfolio/assets/icon-256x256.png?rev=2389881)
 * [Visual Portfolio, Photo Gallery & Post Grid](https://wordpress.org/plugins/visual-portfolio/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/visual-portfolio/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/visual-portfolio/)
 * [Active Topics](https://wordpress.org/support/plugin/visual-portfolio/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/visual-portfolio/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/visual-portfolio/reviews/)

 * 12 replies
 * 2 participants
 * Last reply from: [yelloworange](https://wordpress.org/support/users/yelloworange/)
 * Last activity: [7 years, 5 months ago](https://wordpress.org/support/topic/core-js-file/#post-10847423)
 * Status: resolved