Table of Contents

Slideshow galerie bij aanklikken. Maakt gebruik van modal box.

https://www.w3schools.com/howto/howto_js_slideshow_gallery.asp

Voorbeeld bij Intercolor.

JAVASCRIPT:

 
   <script>
        //Galerij Toepassingsvoorbeelden
        function openModal() {
            document.getElementById("myModal").style.display = "block";
        }

        function closeModal() {
            document.getElementById("myModal").style.display = "none";
        }

        var slideIndex = 1;
        showSlides(slideIndex);

        function plusSlides(n) {
            showSlides(slideIndex += n);
        }

        function currentSlide(n) {
            showSlides(slideIndex = n);
        }

        function showSlides(n) {
            var i;
            var slides = document.getElementsByClassName("mySlides");
            var dots = document.getElementsByClassName("demo");
            var captionText = document.getElementById("caption");
            if (n > slides.length) { slideIndex = 1 }
            if (n < 1) { slideIndex = slides.length }
            for (i = 0; i < slides.length; i++) {
                slides[i].style.display = "none";
            }
            for (i = 0; i < dots.length; i++) {
                dots[i].className = dots[i].className.replace(" active", "");
            }
            slides[slideIndex - 1].style.display = "block";
            dots[slideIndex - 1].className += " active";
            captionText.innerHTML = dots[slideIndex - 1].alt;
        }
    </script>

CSS:

.toepassingen {
    position: relative;
    width: 100%;
    background-image: linear-gradient(to bottom left, #008acf, #204329 );
    display:block;
    padding:30px 0;
}
/*.galerij > .foto {
    padding: 0 8px;
}

.galerij:after {
    content: "";
    display: table;
    clear: both;
}

.foto {
    float: left;
    width: 25%;
}
*/
.galerij {
    display: flex;
    flex-flow: row wrap;
    justify-content: center;
    margin: 0 auto;
    max-width:1200px;
}
.foto {
    position: relative;
    width: 280px;
    margin: 10px;
    border: 1px solid #fff;
}
.thumb {
    width:140px;
    margin:5px;
}
/* The Modal (background) */
.modal {
    display: none;
    position: fixed;
    z-index: 1;
    padding-top: 0px;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0,0,0,0.8);
}

/* Modal Content */
.modal-content {
    position: relative;
    margin: auto;
    padding: 0;
    width: 90%;
    max-width: 1200px;
}

/* The Close Button */
.close {
    color: white;
    position: absolute;
    top: 10px;
    right: 25px;
    font-size: 35px;
    font-weight: bold;
    z-index:2;
}

    .close:hover,
    .close:focus {
        color: #999;
        text-decoration: none;
        cursor: pointer;
    }

/* Hide the slides by default */
.mySlides {
    display: none;
}

/* Next & previous buttons */
.prev,
.next {
    cursor: pointer;
    position: absolute;
    top: 35%;
    width: auto;
    padding: 16px;
    margin-top: -50px;
    color: white;
    font-weight: bold;
    font-size: 20px;
    transition: 0.6s ease;
    border-radius: 0 3px 3px 0;
    user-select: none;
    -webkit-user-select: none;
}

/* Position the "next button" to the right */
.next {
    right: 0;
    border-radius: 3px 0 0 3px;
}

    /* On hover, add a black background color with a little bit see-through */
    .prev:hover,
    .next:hover {
        background-color: rgba(0, 0, 0, 0.8);
    }

/* Number text (1/3 etc) 
.numbertext {
    color: #f2f2f2;
    font-size: 12px;
    padding: 8px 12px;
    position: absolute;
    top: 0;
}
*/
/* Caption text */
.caption-container {
    text-align: center;
    background-color: black;
    padding: 2px 16px;
    color: white;
}

img.demo {
    /*opacity: 0.6;*/
    border:1px solid rgba(0,0,0,0.0)
}

.active,
.demo:hover {
    /*opacity: 1;*/
    border: 1px solid #fff;
}

img.hover-shadow {
    /*   transition: 0.3s; */
}
.hover-shadow {
    border:1px solid rgba(255,255,255,0);
}
.hover-shadow:hover {
    border: 1px solid #fff;
    /*  box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2), 0 6px 20px 0 rgba(0, 0, 0, 0.19); */
}

HTML:

   <div id="toepassingen" class="toepassingen">
        <h2 class="color">Toepassingsvoorbeelden</h2>
        <!-- Images used to open the lightbox -->
        <div class="galerij">
            <div class="foto">
                <img src="toepassing-lichtbruin.jpg" onclick="openModal();currentSlide(1)" class="hover-shadow" style="width:100%; height:100%">
            </div>
            <div class="foto">
                <img src="toepassing-keuken-groen.jpg" onclick="openModal();currentSlide(2)" class="hover-shadow" style="width:100%; height:100%">
            </div>
            <div class="foto">
                <img src="toepassing-keuken-en-trap-in-zwart.jpg" onclick="openModal();currentSlide(3)" class="hover-shadow" style="width:100%; height:100%">
            </div>
            <div class="foto">
                <img src="toepassing-kast-in-wit.jpg" onclick="openModal();currentSlide(4)" class="hover-shadow" style="width:100%; height:100%">
            </div>
            <div class="foto">
                <img src="toepassing-interieur-in-zwart.jpg" onclick="openModal();currentSlide(5)" class="hover-shadow" style="width:100%; height:100%">
            </div>
            <div class="foto">
                <img src="toepassing-interform-zwart.jpg" onclick="openModal();currentSlide(6)" class="hover-shadow" style="width:100%; height:100%">
            </div>
            <div class="foto">
                <img src="toepassing-bureau-in-lichtbruin.jpg" onclick="openModal();currentSlide(7)" class="hover-shadow" style="width:100%; height:100%">
            </div>
            <div class="foto">
                <img src="toepassing-buffetkast-in-groen.jpg" onclick="openModal();currentSlide(8)" class="hover-shadow" style="width:100%; height:100%">
            </div>
        </div>

        <!-- The Modal/Lightbox -->
        <div id="myModal" class="modal">
            <span class="close cursor" onclick="closeModal()">&times;</span>
            <div class="modal-content">

                <div class="mySlides">
                    <img src="toepassing-lichtbruin.jpg" style="width:100%" alt="Interform lichtbruin">
                </div>
                <div class="mySlides">
                    <img src="toepassing-keuken-groen.jpg" style="width:100%" alt="Interform groen">
                </div>
                <div class="mySlides">
                    <img src="toepassing-keuken-en-trap-in-zwart.jpg" style="width:100%">
                </div>
                <div class="mySlides">
                    <img src="toepassing-kast-in-wit.jpg" style="width:100%">
                </div>
                <div class="mySlides">
                    <img src="toepassing-interieur-in-zwart.jpg" style="width:100%">
                </div>
                <div class="mySlides">
                    <img src="toepassing-interform-zwart.jpg" style="width:100%">
                </div>
                <div class="mySlides">
                    <img src="toepassing-bureau-in-lichtbruin.jpg" style="width:100%">
                </div>
                <div class="mySlides">
                    <img src="toepassing-buffetkast-in-groen.jpg" style="width:100%">
                </div>

                <!-- Next/previous controls -->
                <a class="prev" onclick="plusSlides(-1)">&#10094;</a>
                <a class="next" onclick="plusSlides(1)">&#10095;</a>

                <!-- Caption text -->
                <div class="caption-container">
                    <p id="caption"></p>
                </div>

                <!-- Thumbnail image controls -->
                <div class="galerij">
                    <div class="thumb">
                        <img class="demo" src="toepassing-lichtbruin.jpg" onclick="currentSlide(1)" alt="Interform lichtbruin" style="width:100%">
                    </div>

                    <div class="thumb">
                        <img class="demo" src="toepassing-keuken-groen.jpg" onclick="currentSlide(2)" alt="Interform groen" style="width:100%">
                    </div>

                    <div class="thumb">
                        <img class="demo" src="toepassing-keuken-en-trap-in-zwart.jpg" onclick="currentSlide(3)" alt="Interform zwart" style="width:100%">
                    </div>

                    <div class="thumb">
                        <img class="demo" src="toepassing-kast-in-wit.jpg" onclick="currentSlide(4)" alt="Interstar glad" style="width:100%">
                    </div>
                    <div class="thumb">
                        <img class="demo" src="toepassing-interieur-in-zwart.jpg" onclick="currentSlide(5)" alt="Interform zwart" style="width:100%">
                    </div>
                    <div class="thumb">
                        <img class="demo" src="toepassing-interform-zwart.jpg" onclick="currentSlide(6)" alt="Interform zwart" style="width:100%">
                    </div>
                    <div class="thumb">
                        <img class="demo" src="toepassing-bureau-in-lichtbruin.jpg" onclick="currentSlide(7)" alt="Interform lichtbruin" style="width:100%">
                    </div>
                    <div class="thumb">
                        <img class="demo" src="toepassing-buffetkast-in-groen.jpg" onclick="currentSlide(8)" alt="Interform groen" style="width:100%">
                    </div>
                </div>
            </div>
        </div>
    </div>