$(document).ready(function () {
const quantityItem = $('.category2-content-body__items');
quantityItem.each(function () {
const item = $(this).children();
$(this).parents().find('.category2-accordion__title--js').html(item.length);
console.log(item);
console.log(item.length);
});
});
const image = document.querySelectorAll('.zoomimg');
const observer = new IntersectionObserver(
(sections) => {
sections.forEach((section) => {
if (section.intersectionRatio > 0.1) {
section.target.classList.add('active');
} else {
section.target.classList.remove('active');
}
});
},
{ threshold: 0.1 }
);
image.forEach(feature => observer.observe(feature));
let num = 0;
const max = $('.technology-timeline-tab').length;
function autoplay() {
$('.technology-timeline-tab').each(function (id) {
if ($(this).hasClass('active')) {
// eslint-disable-next-line radix
num = parseInt(id) + 1;
}
});
if (num >= max) {
num = 0; // Или обнуляем или останавливаем: return false;
}
$('.technology-timeline-tab').removeClass('active');
$('.technology-timeline-tab').eq(num).trigger('click');
setTimeout(autoplay, 5000);
}
$('.technology-timeline-content__section').mousedown(function () {
$(this).addClass('mousedown');
if ($('.technology-timeline-content__section').hasClass('mousedown')) {
console.log('стоять');
return;
}
});
$(window).mouseup(function () {
if ($('.technology-timeline-content__section').hasClass('mousedown')) {
$('.technology-timeline-content__section').removeClass('mousedown');
autoplay();
console.log('пошла');
}
});
let num = 0;
const max = $('.technology-timeline-tab').length;
function autoplay() {
$('.technology-timeline-tab').each(function (id) {
if ($(this).hasClass('active')) {
// eslint-disable-next-line radix
num = parseInt(id) + 1;
}
});
if (num >= max) {
num = 0; // Или обнуляем или останавливаем: return false;
}
$('.technology-timeline-tab').removeClass('active');
$('.technology-timeline-tab').eq(num).trigger('click');
setTimeout(autoplay, 5000);
const section = $('.technology-timeline-content__section');
section.on('mousedown', function () { ----------------------------- это условие не работает(
setTimeout(autoplay, 20000);
});
}
setTimeout(autoplay, 5000);