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/SBogers10/ijzerenman.komma.pro/wwwroot/js/app/swiper.js
define('swiper',['swiperSrc'],function(swiper)
{

    return {
        initialize : function()
        {
            var t = this;
            var swipers = [];
            var $swiperContainer = $('.swiper-container');

            // Make sure we have a swiper container
            if( ! $swiperContainer.size()) return false;

            // Loop through each swiper container
            $swiperContainer.each(function()
            {
                // Get tab-key and active state
                var $tabHolder = $(this).parent();
                var tab = $tabHolder.data('tab');
                var active = $tabHolder.hasClass('active');

                // Setup slides
                swipers[tab] = new Swiper('.container-tab' + tab,
                {
                    grabCursor: true,
                    speed: 800,
                    spaceBetween: 100,
                    nextButton: '.next' + tab,
                    prevButton: '.prev' + tab,
                    keyboardControl: true,
                    onInit: function(images)
                    {
                        updateCounter(images,tab);
                        $(images.container).parent().addClass('loaded');
                    },
                    onSlideChangeStart : function(images)
                    {
                        updateCounter(images,tab);
                    }
                });
            });


            // Init tab navigation
            $('.tab-navigation').children('li').bind('click',function(e)
            {
                t.switchTab(e)
            });
        },

        /**
         *
         * @param e
         */
        switchTab : function(e)
        {
            var $navigation = $('.tab-navigation');
            var tab = $(e.target).data('tab');

            // Switch tab-holder
            $('.tab-holder.active').removeClass('active');
            $('.tab-holder[data-tab="' + tab + '"]').addClass('active');

            // Switch navigation
            $navigation.children('li.active').removeClass('active');
            $navigation.children('li[data-tab="' + tab + '"]').addClass('active');
        }
    };

    function updateCounter(images,tab)
    {
        var $holder = $('.counter-holder[data-tab="' + tab + '"]');

        var html = (images.activeIndex + 1) + ' / ' + images.slides.length;

        $holder.children('.counter').html(html);
    }
});