How to hide an element when scrolling a specific block (section)?

  • 0
    There is text with `id = arrowText` . Task: when scrolling 2 slides (which has `id = about` ) so that this text is hidden. Is there a hiding option with js?
    IMPORTANT! Don't scroll with an option like:


    `if(scrolled >= 1000)
        {$("#arrowText").hide()}`

    Numeric values ​​are not needed. You need to hide after passing the section by id! Something like that:

    if(scrolled >= '#about'){
            $("#arrowText").hide()}


    Is there a possibility of implementation?
    JavaScript Molly Fry, Sep 4, 2019

  • 1 Answers
  • 0
    if(scrolled >= document.querySelector('#about').height + "px"){
    $("#arrowText").hide()
    }
    Andrew Douglas

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