I am using tippy.js and swiper.js.
I am setting Tippy up as such:
tippy('.tippy', {
allowHTML: true,
theme: 'light div lg',
offset: [0, 16],
});
This works fine.
However, I would like to close/hide tippy instances when a swiper.js has a slideChange event.
On my swiper init file I have:
window['swiper_'+id].on('slideChange', function () {
console.log('slide changed');
const thisTippy = tippy($('.tippy'));
thisTippy.hide();
});
But of course this doesn't work.
Would anyone know how I could access the tippy instance from within the my swiper?
You need to target that particular tooltip's instance. Something like this:
Docs