<div id='id1' style='height: 200px; background-color: red'></div>
<div id='id2' style='height: 200px; background-color: blue'></div>
<div id='id3' style='height: 200px; background-color: green'></div>
let block = document.getElementById('id1');
let blockEvent = block.getBoundingClientRect().bottom + window.pageYOffset;
window.onscroll = function() {
if (window.pageYOffset > blockEvent) {
console.log('it works!');
}};