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/rentman.komma.pro/wwwroot/js/faq.js
/**
 * Created by Pascal on 15/06/16.
 */

$(function () {

    $('.compare-table .table .option .toggle').click(function () {
       $(this).toggleClass('open');
       var index = $(this).index() + 1;
       var parentClass = $(this).parent().attr('class');

       $(".compare-table .table .package ."+parentClass+">*:nth-child("+index+")").toggleClass('open');
    });


    $('.faq-row .nav-types').click(function () {
        enableFaqItems($(this).data('type'));
    });

    $('.faq-row .questions .question').click(function () {
        if($(this).hasClass('inactive')){
            $('.faq-row .questions .question').addClass('inactive');
            $(this).removeClass('inactive');
        }
        else{
            $('.faq-row .questions .question').addClass('inactive');
        }

    });

    $('.currency-switch li').click(function(){
        var currency = $(this).data('currency');

        //change active currency switch item
        $('.currency-switch li.active').removeClass('active');
        $('.currency-switch li[data-currency='+currency+']').addClass('active');

        //change active currency price
        $('.packages .currency-value').addClass('hidden');
        $('.packages .currency-value[data-currency='+currency+']').removeClass('hidden');

        $.post( "/setCurrency", {currency: currency})
            .done(function(data){
                console.log(data);
            });

    });


    function enableFaqItems(type) {
        $('.faq-row .nav-types').removeClass('active');
        $('.faq-row .nav-types[data-type='+type+']').addClass('active');
        $('.faq-row .questions .question').addClass('inactive');
        if(type == 'all'){
            $('.faq-row .questions .question').removeClass('hide');
        }
        else{
            $('.faq-row .questions .question').addClass('hide');
            $('.faq-row .questions .question[data-type='+type+']').removeClass('hide');
        }
    }
});