From e99df98e56437f0629425dc86535690cfab5b763 Mon Sep 17 00:00:00 2001 From: world970511 Date: Sun, 9 Aug 2026 19:54:05 +0900 Subject: [PATCH] [ZEPPELIN-6629] Fix anchor links hidden under navbar --- docs/assets/themes/zeppelin/css/style.css | 4 ++++ docs/assets/themes/zeppelin/js/docs.js | 16 ---------------- 2 files changed, 4 insertions(+), 16 deletions(-) diff --git a/docs/assets/themes/zeppelin/css/style.css b/docs/assets/themes/zeppelin/css/style.css index b07bc25ec45..e0379c8a9f6 100644 --- a/docs/assets/themes/zeppelin/css/style.css +++ b/docs/assets/themes/zeppelin/css/style.css @@ -11,6 +11,10 @@ body { font-size: 15px; } +html { + scroll-padding-top: 60px; +} + .jumbotron { background-color: #3071a9; } diff --git a/docs/assets/themes/zeppelin/js/docs.js b/docs/assets/themes/zeppelin/js/docs.js index 33863a367c7..faf57e413ba 100644 --- a/docs/assets/themes/zeppelin/js/docs.js +++ b/docs/assets/themes/zeppelin/js/docs.js @@ -96,15 +96,6 @@ function viewSolution() { }); } -// A script to fix internal hash links because we have an overlapping top bar. -// Based on https://github.com/twitter/bootstrap/issues/193#issuecomment-2281510 -function maybeScrollToHash() { - if (window.location.hash && $(window.location.hash).length) { - var newTop = $(window.location.hash).offset().top - 57; - $(window).scrollTop(newTop); - } -} - $(function() { codeTabs(); // Display anchor links when hovering over headers. For documentation of the @@ -114,10 +105,6 @@ $(function() { }; anchors.add(); - $(window).bind('hashchange', function() { - maybeScrollToHash(); - }); - $(document).ready(function() { $('#toc').toc(); }); @@ -131,7 +118,4 @@ $(function() { } }); - // Scroll now too in case we had opened the page on a hash, but wait a bit because some browsers - // will try to do *their* initial scroll after running the onReady handler. - $(window).load(function() { setTimeout(function() { maybeScrollToHash(); }, 25); }); });