Элемент плавной прокрутки в поле зрения const smoothScroll = element => document.querySelector(element).scrollIntoView({ behavior: 'smooth' });JavaScriptCopy smoothScroll('#fooBar'); // scrolls smoothly to the element with the id fooBar smoothScroll('.fooBar'); // scrolls smoothly to the first element with a class of fooBarJavaScriptCopy Браузер JavaScript