Now the code is:
function aboutUsAmination() { $(window).scroll(function () { var aboutUs = $('.about_us'); var top = $(aboutUs).offset().top; var scrollFromTop = $(window).scrollTop(); if (scrollFromTop >= top) { console.log("Hello") } }); }; A message is displayed in the console when we are directly crushed to the block (that is, it is at the very top of the screen). I need that at least when it is in the middle of the screen. You can calculate the exact number and take it away from top, but it will have to be taken for each screen resolution.
And so: How to display a message in the console when the block is vertically centered, not at the top