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/SBogers96/smilefotografie.nl/wwwroot/js/app/core/swiper.js
define('core/swiper',['src/swiper'],function(swiper)
{
    return {
        initialize : function()
        {
            var t = this;
            var $container = $('.swiper-container');

            if($container.size())
            {
                $container.addClass('loaded');
                var speed = 1200;

                // Default options
                var options = {
                    grabCursor: true,
                    speed: speed,
                    spaceBetween: 100,
                    //autoplay: 3000,
                    nextButton: '.next',
                    prevButton: '.prev',
                    keyboardControl: true,
                    onInit: function(images)
                    {
                        t.resize();
                        updateCounter(images);

                    },
                    onSlideChangeStart : function(images)
                    {
                        updateCounter(images);
                    }
                };

                // Custom properties
                var custom = $container.attr('data-custom');
                if(typeof custom !== typeof undefined && custom !== false)
                {
                    if(custom == 'home')
                    {
                        options.speed = 1200;
                        options.autoplay = 3000; 
                        options.loop = true;
                        options.spaceBetween = 0;
                        options.effect = 'fade';
                    }
                }

                // Setup slides
                new Swiper('.swiper-container',options);
            }
        },

        resize : function()
        {
            var $swiper = $('.swiper-container');

            if($swiper.hasClass('swiper-resize'))
            {
                var width = $swiper.width();
                var height = width * 2/3;
                $swiper.height(height);
            }
        }
    };

    function updateCounter(images)
    {
        $('.counter').html((images.activeIndex + 1) + ' / ' + images.slides.length);
    }
});