-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathothers.js
46 lines (40 loc) · 1.09 KB
/
others.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
/* When the user clicks on the button,
toggle between hiding and showing the dropdown content */
function toggleDropDown() {
document.getElementById("myDropdown").classList.toggle("show");
}
// Close the dropdown menu if the user clicks outside of it
window.onclick = function(event) {
if (!event.target.matches('.profile')) {
var dropdowns = document.getElementsByClassName("dropdown-content");
var i;
for (i = 0; i < dropdowns.length; i++) {
var openDropdown = dropdowns[i];
if (openDropdown.classList.contains('show')) {
openDropdown.classList.remove('show');
}
}
}
}
var slideIndex = 1;
var slides = document.getElementsByClassName("mySlides");
showSlides(slideIndex);
function plusSlides(n) {
for (i = 0; i < slides.length; i++) {
slides[i].style.display = "none";
}
showSlides(slideIndex += n);
}
function currentSlide(n) {
showSlides(slideIndex = n);
}
function showSlides(n) {
var i;
if (n > slides.length) {
slideIndex = 1
}
if (n < 1) {
slideIndex = slides.length
}
slides[slideIndex - 1].style.display = "block";
}