From ad92e87db65f04a2dcd1ffd00593944d34b076c3 Mon Sep 17 00:00:00 2001 From: pmjklemm Date: Fri, 13 Sep 2024 11:21:24 +0200 Subject: [PATCH] Update main.js --- assets/js/main.js | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/assets/js/main.js b/assets/js/main.js index 346cd95..bc901d5 100644 --- a/assets/js/main.js +++ b/assets/js/main.js @@ -61,17 +61,17 @@ function ChangeSelect(TxtBox) { } function GenerateScrollSpy() { let currentUl = $(''); // Start with an empty list - let currentH1 = null; // Track the current

+ let currentH = null; // Track the current

- $('h1, h2').each(function (index, element) { + $('h2, h3').each(function (index, element) { const tag = $(element).prop('tagName'); - if (tag === 'H1') { - currentH1 = $('
  • ' + $(element).text() + '
  • '); + if (tag === 'H2') { + currentH = $('
  • ' + $(element).text() + '
  • '); currentUl = $(''); // Create a new