Visual Portfolio has a lot of jQuery events that let you extend functionality. Example:
$(document).on('init.vpf', function (event, vpObject) {
if ( 'vpf' !== event.namespace ) {
return;
}
console.log(event, vpObject);
});
Available events
| Event Name | Attributes | Description |
| init.vpf | – | called after the portfolio fully inited |
| destroy.vpf | – | called after portfolio destroyed |
| initOptions.vpf | – | called after new options inited |
| initEvents.vpf | – | called after new events inited |
| destroyEvents.vpf | – | called after events destroyed |
| initLayout.vpf | – | called after layout inited |
| addItems.vpf | $items, removeExisting | called after new items added to the portfolio |
| removeItems.vpf | $items, removeExisting | called after items removed from the portfolio |
| startLoadingNewItems.vpf | url | called before AJAX started to load new items |
| loadedNewItems.vpf | $newVP, removeExisting, data | called after AJAX loaded new items |
| endLoadingNewItems.vpf | – | called after AJAX loaded new items and removed loading state from portfolio |
| initCustomColors.vpf | – | called after custom colors rendered |
| addStyle.vpf | selector, styles, media, stylesList | called after added new custom styles |
| removeStyle.vpf | selector, styles, stylesList | called after removed custom styles |
| renderStyle.vpf | stylesString, stylesList, $style | called after rendered custom styles |
Vendor plugins
| Event Name | Attributes | Description |
| beforeInitIsotope.vpf | options | called before Isotope inited |
| initIsotope.vpf | options | called after Isotope inited |
| destroyIsotope.vpf | – | called after Isotope destroyed |
| beforeInitFjGallery.vpf | options, additionalData | called before fjGallery inited |
| initFjGallery.vpf | options, additionalData | called after fjGallery inited |
| destroyFjGallery.vpf | – | called after fjGallery destroyed |
| beforeInitSwiper.vpf | options | called before Swiper inited |
| initSwiper.vpf | options | called after Swiper inited |
| destroySwiper.vpf | – | called after Swiper destroyed |
| beforeInitFancybox.vpf | options, items, index | called before Fancybox inited |
| initFancybox.vpf | options, items, index, instance | called after Fancybox inited |
| destroyFancybox.vpf | – | called after Fancybox destroyed |
| afterShowFancybox | event | called right after Fancybox show |
| beforeInitPhotoSwipe.vpf | options, items, index, instance | called before PhotoSwipe inited |
| initPhotoSwipe.vpf | options, items, index, instance | called after PhotoSwipe inited |
| destroyPhotoSwipe.vpf | – | called after PhotoSwipe destroyed |