JSFiddle - React, Tailwind, and code Playground

HTML

<h1 id="verschwinden">verschwinden</h1>
<div id="vh">My Height is 100vh</div>

CSS

*{margin:0;}
body{height:3000px;}
#verschwinden{position:fixed; top:0;right:0;}
#vh{background:gold; height:100vh;}

.doch{background:#f0f;}

JavaScript

jQuery(function($) {

    var $nav = $('#verschwinden');
    var $win = $(window);
    var winH = $win.height(); // Get the window height.

    $win.on("scroll", function () {
        if ($(this).scrollTop() > winH ) {
            $nav.addClass("doch");
        } else {
            $nav.removeClass("doch");
        }
    }).on("resize", function(){ // If the user resizes the window
       winH = $(this).height(); // you'll need the new height value
    });

});