diff --git a/src/routes/predseda.svelte b/src/routes/predseda.svelte index e35dcd3..f89341f 100644 --- a/src/routes/predseda.svelte +++ b/src/routes/predseda.svelte @@ -253,7 +253,7 @@ Všechny spolky i SORky mají společný Google kalendář, kam se mimo jiné za
-
1 / 3
+
1 / 2
-
2 / 3
+
2 / 2
-
-
- -
-
- -
+
- + + +
+ + +
+
1 / 3
+ +
+ +
+
2 / 3
+ +
+ +
+
3 / 3
+ +
+ + + + +
+
+ + +
+ + + +
+
@@ -175,31 +207,59 @@
-
-
- -
-
- -
+
- -
-
- + + +
+ + +
+
1 / 4
+ +
+ +
+
2 / 4
+ +
+ +
+
3 / 4
+ +
+
+
4 / 4
+ +
+ + + + +
+
+ + +
+ + + + +
+
diff --git a/static/js/carousel.js b/static/js/carousel.js index 35ba599..043c52e 100644 --- a/static/js/carousel.js +++ b/static/js/carousel.js @@ -14,24 +14,26 @@ function checkElement(selector) { } var slideIndex = 1; +var slideIndex2 = 1; +var slideIndex3 = 1; // Next/previous controls -function plusSlides(n, className = "mySlides") { +function plusSlides(n, className = "mySlides", counter = "slideIndex", dotclass = "dot") { console.log("changing slides"); - showSlides(slideIndex += n, className); + showSlides(window[counter] += n, className, counter, dotclass); } // Thumbnail image controls -function currentSlide(n, className = "mySlides") { - showSlides(slideIndex = n, className); +function currentSlide(n, className = "mySlides", counter = "slideIndex", dotclass = "dot") { + showSlides(window[counter] = n, className, counter, dotclass); } -function showSlides(n, className = "mySlides") { +function showSlides(n, className = "mySlides", counter = "slideIndex", dotclass = "dot") { var i; var slides = document.getElementsByClassName(className); - var dots = document.getElementsByClassName("dot"); - if (n > slides.length) {slideIndex = 1} + var dots = document.getElementsByClassName(dotclass); + if (n > slides.length) {window[counter] = 1} if (n < 1) {slideIndex = slides.length} for (i = 0; i < slides.length; i++) { slides[i].style.display = "none"; @@ -39,9 +41,9 @@ function showSlides(n, className = "mySlides") { for (i = 0; i < dots.length; i++) { dots[i].className = dots[i].className.replace(" carousel-active", ""); } - slides[slideIndex-1].style.display = "block"; - dots[slideIndex-1].className += " carousel-active"; -} + slides[window[counter]-1].style.display = "block"; + dots[window[counter]-1].className += " carousel-active"; +} checkElement('.mySlides') //use whichever selector you want .then((element) => { @@ -52,24 +54,13 @@ checkElement('.mySlides') //use whichever selector you want checkElement('.mySlides2') //use whichever selector you want .then((element) => { console.log("sldaldsaldsa"); - showSlides(slideIndex, "mySlides2"); + showSlides(slideIndex2, "mySlides2", "slideIndex2"); }); checkElement('.mySlides3') //use whichever selector you want .then((element) => { console.log("sldaldsaldsa"); - showSlides(slideIndex, "mySlides3"); -}); - -checkElement('.mySlides4') //use whichever selector you want -.then((element) => { - console.log("sldaldsaldsa"); - showSlides(slideIndex, "mySlides4"); + showSlides(slideIndex3, "mySlides3", "slideIndex3"); }); -checkElement('.mySlides5') //use whichever selector you want -.then((element) => { - console.log("sldaldsaldsa"); - showSlides(slideIndex, "mySlides5"); -});