То, чего вы хотите достичь, это, вероятно,:
Если .second-child
активен, то оповещение
Так что вам нужно что-то вместе с этим
// Event will be triggered after animation to other slide (next or previous).
// @see https://idangero.us/swiper/api/#events
swiper.on('slideChangeTransitionEnd', function() {
// check, if active slide has a class of 'second-child'
if (this.slides[this.realIndex].classList.contains("second-child")) {
alert("active");
}
})
или
swiper.on('slideChangeTransitionEnd', function() {
if (this.realIndex == 1) { // second slide, because of zero indexed counting
alert("active");
}
})
Здесь нет jQuery