• Смена hash в url при скролле?

    @PeterPetrov Автор вопроса
    Вот что я попробовал, но после нескольких прокруток туда сюда вылазит это Throttling navigation to prevent the browser from hanging. See https://crbug.com/1038223. Command line switch --disable-ipc-flooding-protection can be used to bypass the protection
    block.forEach((el) => {
            const pos = el.getBoundingClientRect();
    
            if (pos.top < window.innerHeight / 2 && pos.bottom > 0) {
              history.pushState(null, null, `#${el.id}`);
            } else {
               history.pushState(null, null, '');
            }
          });
    Ответ написан
    Комментировать