There is a script, it is necessary that it starts running at a screen resolution of> 1200px and does not work on small monitors. How to implement it?
<script type="text/javascript"> $(function() { var topPos = $('.floating').offset().top; $(window).scroll(function() { var top = $(document).scrollTop(), pip = $('#send-letter').offset().top, //расстояние до подвала от верха окна браузера height = $('.floating').outerHeight(); //получаем значение высоты пл.блока if (top > topPos && top < pip - height) { $('.floating').addClass('fixed').fadeIn(); } //блок будет виден, если значения соответствуют указанным else if (top > pip - height) { $('.floating').fadeOut(200); } //блок скроется когда достигнет заданного расстояния else { $('.floating').removeClass('fixed'); } }); }); </script>