How to hide a fixed block when scrolling to the footer?

  • 0
    I have a div fixed to the bottom of the page on top of the rest. It has a button that, when pressed, the user moves to the footer.
    How do I hide this div when the user has scrolled or moved to the footer?

    <div id="sticky" class="sticky">Контент</div>
    <footer id="footer" class="footer">Контент</footer>

    .sticky {
        display: block;
        left: 0;
        right: 0;
        visibility: visible;
        position: fixed;
        width: 100%;
        z-index: 99999;
    }
    JavaScript Anonymous, Aug 17, 2020

  • 1 Answers
  • 0
    getBoundingClientRect + scroll
    Anonymous

Your Answer
To place the code, please use CodePen or similar tool. Thanks you!