Gewerkschaftsschule Schweiz

Der Verein unterstützt mit seinen Beiträgen die Stiftung Gewerkschaftsschule Schweiz GSS.

<script>

(function() {

    document.addEventListener('DOMContentLoaded', function() {
        load();
    });

    function load() {

        var images = [            '/wp-content/uploads/2022/09/fv-de_0000_Home-1.png',            '/wp-content/uploads/2022/09/fv-de_0000_Home-2.png',            '/wp-content/uploads/2022/09/fv-de_0000_Home-3.png',            '/wp-content/uploads/2022/09/fv-de_0000_Home-4.png'        ];

        preload(images);

        var imgElems = document.getElementsByTagName('img');
        for (var i = 0; i < imgElems.length; i++) {
            imgElems[i].style.backgroundImage = 'url(/wp-content/uploads/2022/09/fv-de_0000_Home-1.png)';
        }

        var mainBg = document.querySelector('.gss-home__mainbg');

        fadeIn(mainBg, 200, 0.9, function() {
            mainBg.style.backgroundImage = 'url(/wp-content/uploads/2022/09/fv-de_0000_Home-2.png)';
            fadeIn(mainBg, 100, 1);
        });

        fadeIn(mainBg, 400, 0.9, function() {
            mainBg.style.backgroundImage = 'url(/wp-content/uploads/2022/09/fv-de_0000_Home-3.png)';
            fadeIn(mainBg, 100, 1);
        });

        fadeIn(mainBg, 600, 0.9, function() {
            mainBg.style.backgroundImage = 'url(/wp-content/uploads/2022/09/fv-de_0000_Home-4.png)';
            fadeIn(mainBg, 100, 1);
        });
    }

    function preload(images) {
        for (var i = 0; i < images.length; i++) {
            var img = new Image();
            img.src = images[i];
        }
    }

    function fadeIn(elem, delay, opacity, callback) {
        elem.style.transition = 'opacity ' + delay + 'ms';
        elem.style.opacity = opacity;
        setTimeout(callback, delay);
    }

})();

</script>