Currently, I am working on a website which can be accessed at the following link: . You can find a helpful example link below.
How to change active class while click to another link in bootstrap use jquery?
Now, I will showcase the code that I have written and where you can locate it in the JS file.
HTML: The code snippet provided begins on line 77 when you open the DEBUG console or scroll down to the <nav> tag.
<!-- HTML code goes here -->
JS: You can find the relevant Javascript code starting from line 194 or by scrolling until you reach this specific code.
// Javascript code goes here
Let me walk you through some issues that I am currently facing:
FIRST: Upon clicking on the "Learn more..." button of the first slide, the page should smoothly scroll down to the GET A QUOTE section where the yellow bar with the text "GET A QUOTE" appears. However, this functionality is not working as expected.
SECOND: If you navigate from the base URL and scroll until the menu becomes visible, you will notice that the HOME menu item is highlighted as active. But, upon clicking on other menu items like About, the active highlight does not switch accordingly.
THIRD: When scrolling from the base URL to the section labeled "Roofing Services We Offer," you will see that SPRAY FOAM ROOFING is already marked as active. However, clicking on any other menu item does not trigger the corresponding active status for the specified content unless clicked directly.
If you view the screenshots linked below, you can observe the discrepancies that occur:
https://i.sstatic.net/zoGEC.png
In summary, I suspect that the issue lies in how the ACTIVE class is handled, potentially removing all active classes from every element whenever the addEventListener() function is executed.
Any assistance in resolving these issues would be greatly appreciated. Thank you for your support.