$(document).ready(function() {
var oldId = null;
$('.pt_tabs__controls__link').click(function(e) {
e.preventDefault();
if ($(this).hasClass('pt_tabs__controls__link--active')) {
return false;
}
var currentId = parseInt($(this).data('id'), 10);
$('.pt_tabs__controls__link--active').removeClass('pt_tabs__controls__link--active');
$(this).addClass('pt_tabs__controls__link--active');
if (currentId < oldId) { // item is hidden
var timing = $('.card.hidden').length * 100;
$('.card').each(function(index) {
if (index > (currentId - 1 ) || index == (currentId - 1)) {
window.setTimeout(function() {
$('.card').eq(index).removeClass('hidden');
}, timing - (index * 100));
}
});
} else {
$('.card').each(function(index) {
if (index < (currentId - 1)) {
window.setTimeout(function() {
$('.card').eq(index).addClass('hidden');
}, index * 100);
}
});
}
oldId = currentId;
});
});
This line is generating $ not defined issue where am I going wrong?
$('.pt_tabs__controls__link').click(function(e) {