-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathj.js
80 lines (66 loc) · 1.96 KB
/
j.js
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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
const date = new Date();
document.getElementById("date").innerHTML =date;
// Function to show the popup
function showPopup() {
var popup = document.getElementById("popup");
popup.style.display = "block";
}
// Function to close the popup
function closePopup() {
var popup = document.getElementById("popup");
popup.style.display = "none";
}
// Show the popup when the page loads
window.onload = function () {
showPopup();
};
/*video*/
// Function to show the popup
function showPopup() {
var popup = document.getElementById("popup");
popup.style.display = "block";
}
// Function to close the popup
function closePopup() {
var popup = document.getElementById("popup");
popup.style.display = "none";
}
// Show the popup when the page loads
window.onload = function () {
showPopup();
};
/*video end*/
let slideIndex = 0;
showSlides();
function showSlides() {
let i;
let slides = document.getElementsByClassName("mySlides");
let dots = document.getElementsByClassName("dot");
for (i = 0; i < slides.length; i++) {
slides[i].style.display = "none";
}
slideIndex++;
if (slideIndex > slides.length) {slideIndex = 1}
for (i = 0; i < dots.length; i++) {
dots[i].className = dots[i].className.replace(" active1", "");
}
slides[slideIndex-1].style.display = "block";
dots[slideIndex-1].className += " active1";
setTimeout(showSlides, 4000); // Change image every 2 seconds
}
//top button
let mybutton = document.getElementById("myBtn");
// When the user scrolls down 20px from the top of the document, show the button
window.onscroll = function() {scrollFunction()};
function scrollFunction() {
if (document.body.scrollTop > 20 || document.documentElement.scrollTop > 20) {
mybutton.style.display = "block";
} else {
mybutton.style.display = "none";
}
}
// When the user clicks on the button, scroll to the top of the document
function topFunction() {
document.body.scrollTop = 0;
document.documentElement.scrollTop = 0;
}