I need help with highlighting the navbar item that corresponds to a specific section when clicked or scrolled into view. I've tried using CSS properties and Bootstrap, but I can't seem to get it working. Any assistance would be greatly appreciated.
Here is the code snippet I have:
$(function() {
$('#sidebarCollapse').on('click', function() {
$('#sidebar, #content').toggleClass('active');
});
});
html {
scroll-behavior: smooth;
}
body {
position: relative;
}
.vertical-nav {
min-width: 19rem;
width: 19rem;
height: 100vh;
position: fixed;
top: 0;
left: 0;
box-shadow: 3px 3px 10px rgba(0, 0, 0, 0.1);
transition: all 0.4s;
}
// Rest of the CSS properties...
<!doctype html>
<html lang="en">
// HTML code here...
</html>