HTML <body>直下 <div class="gmenu"> コンテンツ </div> css .gmenu { position: fixed; width: 100%; z-index: 100; top: -100px; //gmenuの高さ height: 100px; } .gmenu.fixed { position: fixed; top: 0; left: 0; } js $(function () { var headNav = $('.gmenu'); $(window).on('load scroll', function () { if ($(this).scrollTop() > 500 && headNav.hasClass('fixed') == false) { headNav.css({ "top": '-100px' }); headNav.add
![スクロールすると上から降りてくる](https://cdn-ak-scissors.b.st-hatena.com/image/square/8e23181c02f802e16c952721065b7546c4d9b32f/height=288;version=1;width=512/https%3A%2F%2Fatelierroi.com%2Fatelierroi%2Fwp-content%2Fthemes%2Fatelierroi2019%2Fimages%2Fogimg_01.png)