I am creating teams rating site. Here i need to use js, but i cant understand, what is wrong.
function teamopen() {
if ($('.tb-one-middle').eq(event.page.index).hasClass('current')) {
$('.tb-one-middle').eq(event.page.index).removeClass('current');
} else {
$('.tb-one-middle').eq(event.page.index).addClass('current');
}
}
this is my script, it is based onclick from element. I will have many copied elements on one page, they have same classes. So, the script need to open the full information about team with photos, when we click on element. Firstly only the first team has class active. But i need to add this class to any other objects without deleting it from already existing elements.
This is the screenshot of html part of my site.
Thanks for all in advance!