There is an anchor. It is necessary that when you click on the corresponding link, the hash is added to the address bar, and the physical scrolling should not be performed. This is what I found on the Internet and I made one. Works with bugs. Is there a more universal solution?
$('a[href^="#img"]').bind('click.smoothscroll',function (e) { e.preventDefault(); var target = this.hash, $target = $(target); $('html, body').stop().animate({ 'scrollTop': window.pageYOffset}); window.location.hash = target; });