Updated
This commit is contained in:
parent
c7300bddd3
commit
e22a2beaa6
20
assets/js/header.js
Normal file
20
assets/js/header.js
Normal file
@ -0,0 +1,20 @@
|
||||
|
||||
document.querySelectorAll('.nav-link').forEach(function(link) {
|
||||
link.addEventListener('click', function(e) {
|
||||
|
||||
const navbarCollapse = document.getElementById('navbarSupportedContent');
|
||||
const bsCollapse = new bootstrap.Collapse(navbarCollapse, {
|
||||
toggle: false
|
||||
});
|
||||
bsCollapse.hide();
|
||||
|
||||
const targetId = this.getAttribute('href').split('#')[1];
|
||||
const targetElement = document.getElementById(targetId);
|
||||
|
||||
if (targetElement) {
|
||||
targetElement.scrollIntoView({
|
||||
behavior: 'smooth'
|
||||
});
|
||||
}
|
||||
});
|
||||
});
|
@ -8,7 +8,7 @@
|
||||
<link href="https://cdn.jsdelivr.net/npm/bootstrap-icons/font/bootstrap-icons.css" rel="stylesheet">
|
||||
<link rel="stylesheet" href="../assets/css/header.css">
|
||||
<style>
|
||||
|
||||
/* Add custom styles here if needed */
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
@ -40,7 +40,7 @@
|
||||
<div class="collapse navbar-collapse" id="navbarSupportedContent">
|
||||
<ul class="navbar-nav mx-auto mb-2 mb-lg-0">
|
||||
<li class="nav-item">
|
||||
<a class="homeactive nav-link active" aria-current="page" href="http://localhost/bibhuti_solutions/templates/#home">HOME</a>
|
||||
<a class="homeactive nav-link active" href="http://localhost/bibhuti_solutions/templates/#home">HOME</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" href="http://localhost/bibhuti_solutions/templates/#about">ABOUT</a>
|
||||
@ -62,7 +62,8 @@
|
||||
</div>
|
||||
</div>
|
||||
</nav>
|
||||
</section>
|
||||
|
||||
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/js/bootstrap.bundle.min.js" integrity="sha384-YvpcrYf0tY3lHB60NNkmXc5s9fDVZLESaAA55NDzOxhy9GkcIdslK1eN7N6jIeHz" crossorigin="anonymous"></script>
|
||||
<script src="../assets/js/header.js"></script>
|
||||
</body>
|
||||
</html>
|
||||
|
@ -1,5 +1,4 @@
|
||||
<?php
|
||||
// Include the data file from assets/data/
|
||||
include '../assets/data/servicesData.php';
|
||||
?>
|
||||
|
||||
@ -57,9 +56,6 @@ foreach ($servicesData as $service) {
|
||||
";
|
||||
}
|
||||
?>
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user