JavaScript
- 1 ответ
- 0 вопросов
1
Вклад в тег
const paragraphs = document.querySelectorAll('.advantages_grid p');
const addNotActiveClass = () => {
paragraphs.forEach(x => x.classList.add('not-active'))
}
const removeNotActiveClass = () => {
paragraphs.forEach(x => x.classList.remove('not-active'))
}
const calcWindow = () => {
if (window.innerWidth < 600) {
addNotActiveClass()
} else {
removeNotActiveClass()
}
}
document.addEventListener('DOMContentLoaded', () => {
calcWindow()
});
window.addEventListener("resize", (e) => {
calcWindow()
});