<!--
    <script>
        (function (w, d, i) {
            function debounce(func, wait) {
                let timeout;
                return function () {
                    const context = this;
                    const args = arguments;
                    clearTimeout(timeout);
                    timeout = setTimeout(() => func.apply(context, args), wait);
                };
            }

            var navbar = d.getElementById(i);
            var prevScrollpos = w.pageYOffset;
            w.onscroll = debounce(function () {
                var currentScrollPos = w.pageYOffset;
                if (Math.abs(currentScrollPos - prevScrollpos) > 5) { // 滚动阈值
                    if (prevScrollpos > currentScrollPos) {
                        navbar.style.transform = 'translateY(0)';
                    } else {
                        navbar.style.transform = 'translateY(-150px)';
                    }
                    prevScrollpos = currentScrollPos;
                }
            }, 25) // 防止快速滚动时频繁触发
        })(window, document, 'pc_nav');
    </script>
-->
master
candice 3 weeks ago
parent c6b8de9435
commit f8cb5c30df

@ -665,7 +665,7 @@
</div>
</div>
</footer>
<!--
<script>
(function (w, d, i) {
function debounce(func, wait) {
@ -693,7 +693,7 @@
}, 25) // 防止快速滚动时频繁触发
})(window, document, 'pc_nav');
</script>
-->
<!--@PRODUCT-JS@-->
<!--@ADDON-JS@-->
<script>eval(function (p, a, c, k, e, d) {

Loading…
Cancel
Save