From 6391801a10a7424817f99370f5a5a614c413af10 Mon Sep 17 00:00:00 2001 From: Bismin271172 <118316066+Bismin271172@users.noreply.github.com> Date: Mon, 25 Mar 2024 15:09:03 +0700 Subject: [PATCH] Update script.js --- script.js | 21 ++++++++++----------- 1 file changed, 10 insertions(+), 11 deletions(-) diff --git a/script.js b/script.js index cb468bc..01e0400 100644 --- a/script.js +++ b/script.js @@ -17,14 +17,13 @@ window.onscroll = () => { navbar.classList.remove('open'); } - - $('section').each(function(){ - var top = $(window).scrollTop(); - var id = $(this).attr('id'); - var height = $(this).height(); - var top = $(this).offset().top - 200; - if(top >= offset && top < height + offset){ - $('.navbar ul li a').removeClass('active'); - $('.navbar').find('[href="#' + id +'"]').addClass('active'); - } - }); \ No newline at end of file +// $('section').each(function(){ +// var id = $(this).attr('id'); +// var height = $(this).height(); +// var offset = $(this).offset().top - 200; +// var top = $(window).scrollTop(); +// if(top >= offset && top < offset + height){ +// $('.navbar ul li a').removeClass('active'); +// $('.navbar').find('[data-scroll="#' + id +'"]').addClass('active'); +// } +// }); \ No newline at end of file