HEX
Server: Microsoft-IIS/8.5
System: Windows NT YDAWBH120 6.3 build 9600 (Windows Server 2012 R2 Standard Edition) AMD64
User: tentjecom_web (0)
PHP: 7.4.14
Disabled: NONE
Upload Files
File: D:/HostingSpaces/SBogers37/rieff.eu/wwwroot/js/main.js
$(document).ready(function(){
    // image hover
    $('a.komma-mediadesign').hover(function(){
        $('img.komma-mediadesign.hover').css({ display : 'block' });
    },
    function()
    {
        $('img.komma-mediadesign.hover').css({ display : 'none' });
    });


    if($('#photoGalleryFrame').length){
        var activeFoto = 0;
        var totalFotos = $("#photoGalleryFrame li").length;
        var fotoWidth = $("#photoGalleryFrame").width();
        var ulWidth =  totalFotos * fotoWidth;
        $("#photoGalleryFrame ul").css({'width':ulWidth+'px'});
        $("#photoGalleryMenu li").eq(0).toggleClass("active");
        var galleryPlay = true;
        var newPos = 0;

        function fotoRotateGallery(){
            if(galleryPlay){
                $.doTimeout( 3000, function(){
                    if(galleryPlay){
                        $("#photoGalleryMenu li").eq(activeFoto).toggleClass("active");
                        if(activeFoto == 0){
                            $("#photoGalleryFrame ul").css("left", "0");
                        }
                        activeFoto = activeFoto + 1;
                        newPos = activeFoto * fotoWidth * -1 + "px";
                        if(activeFoto == totalFotos - 1){ activeFoto = 0; }
                        $("#photoGalleryMenu li").eq(activeFoto).toggleClass("active");
                        $("#photoGalleryFrame ul").stop().animate({"left": newPos}, "slow");

                        fotoRotateGallery();
                    }
                });
            }
        }
        fotoRotateGallery();

        $('#photoGalleryMenu li').each(function(index) {
            $(this).click(function(){
                clickProjectAction(index);
            });
        });

        function clickProjectAction(newProjectActive){

            $("#photoGalleryMenu li").eq(activeFoto).toggleClass("active");
            galleryPlay = false;
            var newPos = newProjectActive * fotoWidth * -1 + "px";
            $("#photoGalleryFrame ul").stop().animate({"left": newPos}, "slow");
            $("#photoGalleryMenu li").eq(newProjectActive).toggleClass("active");
            activeFoto = newProjectActive;
        }
    }

});