<html>
, так не работает...let pageHeight = page.clientHeight;
let scrollH = page.scrollHeight;
let scrolled = page.scrollHeight - top;
function comparison() {
let arr = [
parseInt(scrolled),
parseInt(scrolled) + 1,
parseInt(scrolled) - 1,
];
return arr.includes(pageHeight) ? true : false;
}
if (comparison()) {
popup.classList.add('form__container--show');
footer.classList.remove('main-footer--hidden');
console.log(pageHeight);
console.log(scrolled);
} else {
console.log(pageHeight);
console.log(scrolled);
popup.classList.remove('form__container--show');
footer.classList.add('main-footer--hidden');
}
https://codepen.io/Hocus/pen/yLEGWay