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/SBogers93/fitale.nl/wwwroot/js/method-slider.js
/**
 * Created by Pascal on 11/10/16.
 */

$(function () {

    initSlider();

    $('.methods .method .next').click(function () {
        $('.methods .method, .methods-select li').removeClass('active');
        var step = $(this).parent().next().data('step');
        $('.methods-select li[data-step="'+step+'"]').addClass('active');
        $(this).parent().next().addClass('active');

    });

    $('.methods-select li').click(function () {
        var step = $(this).data('step');
        $('.methods .method, .methods-select li').removeClass('active');
        $('.methods .method[data-step="'+step+'"], .methods-select li[data-step="'+step+'"]').addClass('active');
        console.log(step);
    });

    $(window).resize(function () {
        initSlider();
    });
});


function initSlider() {
    var sliderHeight = 0;

    $('.methods .method').each(function () {
        if ($(this).height() > sliderHeight) sliderHeight = $(this).height();
    });

    $('.methods').height(sliderHeight);
    $('.methods-select').height(sliderHeight);
    $('.methods .method').first().addClass('active');
    $('.methods-select li').first().addClass('active');
}