---
title: "jQuery Methods"
date: 2018-09-09
author: "nK"
---

# jQuery Methods

Sometimes you may need to call Visual Portfolio methods manually, for example when you use AJAX page load, you will need to reinitialize portfolio, so you can use public methods. Example:

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

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

### Available methods:

Method NameAttributesDescription**init** –init/reinit portfolio**destroy**–destroy portfolio**resized**–portfolio was resized**addStyle**selector, styles, mediaadd custom styles to the current portfolio**removeStyle**selector, styles, mediaremove custom styles from the current portfolio**renderStyle**–render custom styles**addItems**$items, removeExistingadd new items to portfolio (called after AJAX loading)**removeItems**$itemsremove some items from portfolio (called after AJAX loading in Paged pagination)## Notes

- `$.fn.vpf.noConflict()` returns the plugin function if another plugin uses `$.fn.vpf`.
- Every `.vp-portfolio` element is initialised on load, and again when it is inserted into the DOM later: a mutation observer watches for `.vp-portfolio:not(.vp-portfolio__ready)`. Galleries brought in by AJAX page transitions usually need no manual call. The instance is available as `element.vpf`.
- `window.VPPopupAPI.open( items, index, $gallery )` opens the lightbox with your own items. The same object serves `.vp-lightbox-gallery` containers.