-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathscript.js
More file actions
31 lines (24 loc) · 891 Bytes
/
script.js
File metadata and controls
31 lines (24 loc) · 891 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
// transition
document.querySelector('.nav-link').addEventListener('click', function(event) {
event.preventDefault(); // Prevent the default link behavior
document.body.classList.add('home');
setTimeout(function() {
window.location.href = "home.html"; // Replace with your actual page URL
}, 500); // Add a delay for the transition to complete before navigating
});
// JavaScript for the image slideshow
var slideIndex = 0;
showSlides();
function showSlides() {
var i;
var slides = document.getElementsByClassName("mySlides");
for (i = 0; i < slides.length; i++) {
slides[i].style.display = "none";
}
slideIndex++;
if (slideIndex > slides.length) {
slideIndex = 1;
}
slides[slideIndex - 1].style.display = "block";
setTimeout(showSlides, 2000); // Change image every 2 seconds
}