let imgArticle = document.querySelector(".img_article");
function onScroll() {
let posTop = imgArticle.getBoundingClientRect().top;
if(posTop >= 0) {
imgArticle.style.display = "fixed";
}
}
document.addEventListener("scroll", onScroll);
console.log(imgArticle.getBoundingClientRect().top);
все равно не сработало