Я использую этот скрипт, чтобы иметь возможность прокручивать раздел по горизонтали.
https://codepen.io/ellisclicky/pen/vvwRKN
$horizontalScrollSections.each(function (i, el) {
var $thisSection = $(this);
$(this).data('elDom', $(this).get(0));
// Set up horizontal scrolling data attributes and show section all have been computed.
setUpHorizontalScroll($(this));
// Now we're ready, call setScene on load that adds classes based on scroll position.
setScene($(this));
// Resize function
$(window).on('resize', function () {
// Reset horizontal scrolling data attributes and transform content wrapper if transform is bigger than scroll width.
resetHorizontalScroll($thisSection);
// Reset scene positioning.
setScene($thisSection);
});
Я усек код выше немного. Рабочий пример по ссылке codepen.io выше.
Я хочу добавить класс в div (с именем horizontal-scroll-section__content-section в настоящее время) в области просмотра.
Как один go собирается это сделать?
Супер благодарен за любые ответы.