Your IP : 18.190.217.197


Current Path : /var/www/u0635749/data/www.layout.tequiladance.ru/js/
Upload File :
Current File : /var/www/u0635749/data/www.layout.tequiladance.ru/js/script.js

$(document).ready(function () {
    var time_input = '';
    $('.select_block').find('.scroll').mCustomScrollbar({
        theme: "rounded-dots",
        scrollInertia: 400
    })
    $('.scroll_time').mCustomScrollbar({
        theme: "rounded-dots",
        scrollInertia: 400
    })
    setTimeout(function () {
        $('.select_block').find('.option').css({
            'opacity': 1,
            'z-index': 1,
            'display': 'none'
        })
    }, 1000)
    $('.select_block').find('input').focus(function () {
        $(this).parents('.select_block').find('.option').slideDown(300);


    })
    $('.select_block').find('input').focusout(function () {
        var block = $(this);
        setTimeout(function () {
            $(block).parents('.select_block').find('.option').slideUp(300);
        }, 200)
    })
    $('.option').find('li').click(function () {
        var val = $(this).find('a').find('span').html();

        $(this).parents('.select_block').find('.cheng').removeClass('cheng');
        $(this).addClass('cheng');
        $(this).parents('.select_block').find('input').val(val);
        $(this).parents('.select').removeClass('open');
        return false
    })
    $('.sendvico_block').mouseenter(function () {
        var win_w = $(window).outerWidth();
        if (win_w < 400) {
            $(this).find('.pod_menu').css({
                'opacity': 0,
                'display': 'block',
                'width': win_w,
                'right': -15,
            })
            $(this).find('.pod_menu').css({
                'opacity': 1,
                'display': 'none',

            })
        }
        $(this).find('.pod_menu').slideDown(300);
    })
    $('.sendvico_block').mouseleave(function () {
        $('.pod_menu').slideUp(300);
    })
    var flag5=$('.about_slider').length;
  if(flag5>0){
    setTimeout(function () {
        $('.about_slider').slick({
            slidesToShow: 5,
            slidesToScroll: 1,
            prevArrow: ' <a href="javascript:void(0)" class="arrow prev"></a>',
            nextArrow: ' <a href="javascript:void(0)" class="arrow next"></a>',
            dots: true,
            responsive: [
                {
                    breakpoint: 1442,
                    settings: {
                        slidesToShow: 4,
                    }
                },
                {
                    breakpoint: 1200,
                    settings: {
                        slidesToShow: 3,
                    }
                },
                {
                    breakpoint: 992,
                    settings: {
                        slidesToShow: 2,
                    }
                },

            ]
        })
    },500)
  }

    var win_w = $('.wraper').outerWidth()
    if (win_w < 1200) {
      var flag6=$('.tametable_slider').length;
       if(flag6>0){
           $('.tametable_slider').slick({
               slidesToShow: 2,
               slidesToScroll: 1,
               prevArrow: ' <a href="javascript:void(0)" class="arrow prev"></a>',
               nextArrow: ' <a href="javascript:void(0)" class="arrow next"></a>',
               responsive: [
                   {
                       breakpoint: 896,
                       settings: {
                           slidesToShow: 2,
                       }
                   },
                   {
                       breakpoint: 786,
                       settings: {
                           slidesToShow: 1,
                       }
                   },

               ]

           })
       }
    }
    var flag7=$('.teatchers_slider').length;
   if(flag7>0){
       $('.teatchers_slider').slick({
           slidesToShow: 4,
           slidesToScroll: 1,
           prevArrow: ' <a href="javascript:void(0)" class="arrow prev"></a>',
           nextArrow: ' <a href="javascript:void(0)" class="arrow next"></a>',
           responsive: [
               {
                   breakpoint: 1600,
                   settings: {
                       slidesToShow: 3,
                   }
               },
               {
                   breakpoint: 1542,
                   settings: {
                       slidesToShow: 2,
                   }
               },
               {
                   breakpoint: 1200,
                   settings: {
                       slidesToShow: 1,
                   }
               },

           ]

       })
   }
   var flag8=$('.data_slider').length;
 if(flag8>0){
     $('.data_slider').slick({
         slidesToShow: 4,
         slidesToScroll: 1,
         prevArrow: ' <a href="javascript:void(0)" class="arrow prev_time"></a>',
         nextArrow: ' <a href="javascript:void(0)" class="arrow next_time"></a>',
         infinite: false,
         asNavFor: '.slider_time',
         responsive: [
             {
                 breakpoint: 572,
                 settings: {
                     slidesToShow: 3,
                 }
             },
             {
                 breakpoint: 465,
                 settings: {
                     slidesToShow: 2,
                 }
             },


         ]

     })
 }
 var flag9=$('.slider_time').length;
  if(flag9>0){
      $('.slider_time').slick({
          slidesToShow: 4,
          slidesToScroll: 1,
          asNavFor: '.data_slider',
          arrows: false,
          infinite: false,
          responsive: [
              {
                  breakpoint: 572,
                  settings: {
                      slidesToShow: 3,
                  }
              },
              {
                  breakpoint: 465,
                  settings: {
                      slidesToShow: 2,
                  }
              },


          ]


      })
  }
    $('.slider_time').find('.slide_block').click(function () {
        var time = $(this).html()
        var index = $(this).parents('.slide').index();
        var day = $('.data_slider').find('.slide').eq(index).find('p').html().split(',');
        var day_all = $('.data_slider').find('.slide').eq(index).find('p').attr('data-data');
        $('.thanks_popap').find('#popap_data').html(day_all)
        $('.thanks_popap').find('#popap_time').html(time)
        var total_time = day[0] + ':' + ' ' + time
        console.log(time_input)
        $(time_input).val(total_time)
        $('.time_popap').fadeOut(500)
    })
    var arrow_left = $('.content').offset().left + 15;
    var arrow_right = $('.content').offset().left + $('.content').outerWidth();
    var left = $('.content').offset().left + 15 + $(window).width() / 100 * 2.161;
    var left2 = $('.content').offset().left + 5
    $('.about_slider').css('margin-left', left);
    $('.teatchers_slider').css('margin-left', left2);
    setTimeout(function () {
        $('.prev').css('left', arrow_left);
        $('.next').css('left', arrow_right);
    },700)

    $(window).resize(function () {
        var arrow_left = $('.content').offset().left + 15;
        var arrow_right = $('.content').offset().left + $('.content').outerWidth();
        var left = $('.content').offset().left + 15 + $(window).width() / 100 * 2.161;
        var left2 = $('.content').offset().left + 5
        $('.about_slider').css('margin-left', left);
        $('.teatchers_slider').css('margin-left', left2);
        $('.prev').css('left', arrow_left);
        $('.next').css('left', arrow_right);
        return
    })
    $("#tel").mask("(999) 999-99-99");
    setTimeout(function () {
        $('.popap_ring').css({
            'opacity': 1,
            'z-index': 10,
            'display': 'none'
        })
        $('.fon').css({
            'opacity': 1,
            'z-index': 999,
            'display': 'none'
        })
    }, 500)
    $('.open_ring').click(function () {
        $('.fon').fadeIn(500);
        $('.popap_ring').css({
            'opacity': 0,
            'display': 'block'
        })
        var left = ($(window).outerWidth() - $('.popap_ring').outerWidth()) / 2;
        var top = ($(window).outerHeight() - $('.popap_ring').outerHeight()) / 2;
        if (top < 0) {
            top = 0
        }
        $('.popap_ring').css({
            'opacity': 1,
            'display': 'none',
            'left': left,
            'top': top
        })
        setTimeout(function () {
            $('.popap_ring').fadeIn(500);
        }, 500);
        $('#submit').click(function () {
            $('.popap_ring').fadeOut(500)
            $('.popap_sale').css({
                'opacity': 0,
                'display': 'block'
            })
            var left2 = ($(window).outerWidth() - $('.popap_sale').outerWidth()) / 2;
            var top2 = ($(window).outerHeight() - $('.popap_sale').outerHeight()) / 2;
            $('.popap_sale').css({
                'opacity': 1,
                'display': 'none',
                'left': left2,
                'top': top2
            })
            setTimeout(function () {
                $('.popap_sale').fadeIn(500);
            }, 100);
        })

        $('.fon').click(function () {
            $('.popap').fadeOut(500);
            setTimeout(function () {
                $('.fon').fadeOut(500)
            }, 500)
        })
        $('.popap').click(function (e) {
            e.stopPropagation();
        })

    })
    $('.open_graph').click(function () {
        $('.fon').fadeIn(500);
        $('.popap_graph').css({
            'opacity': 0,
            'display': 'block'
        })

        var left = ($(window).outerWidth() - $('.popap_graph').outerWidth()) / 2;
        var top = ($(window).outerHeight() - $('.popap_graph').outerHeight()) / 2;
        if (top < 0) {
            top = 0
        }
        $('.popap_graph').css({
            'opacity': 1,
            'display': 'none',
            'z-index':10,
            'left': left,
            'top': top
        })

        setTimeout(function () {
            $('.popap_graph').fadeIn(500);

        }, 500);
        setTimeout(function () {
            var left=$('.popap_graph').find('.table_scroll2').find('.table_line').outerWidth()-$('.popap_graph').find('.table_scroll2').outerWidth();
            $('.popap_graph').find('.table_scroll2').animate({scrollLeft: left}, 2500);
            setTimeout(function () {
                $('.popap_graph').find('.table_scroll2').animate({scrollLeft: 0}, 2500);
                setTimeout(function () {
                    $(el).clearQueue();
                    $(el).stop()
                },5000)
            })
        },600)

        $('.fon').click(function () {
            $('.popap').fadeOut(500);
            setTimeout(function () {
                $('.fon').fadeOut(500)
            }, 500)
        })
        $('.popap').click(function (e) {
            e.stopPropagation();
        })

    })
    $('.open_select').click(function () {
        $('.fon').fadeIn(500);
        $('.popap_select').css({
            'opacity': 0,
            'display': 'block'
        })
        var left = ($(window).outerWidth() - $('.popap_select').outerWidth()) / 2;
        var top = ($(window).outerHeight() - $('.popap_select').outerHeight()) / 2;
        if (top < 0) {
            top = 0
        }
        $('.popap_select').css({
            'opacity': 1,
            'display': 'none',
            'left': left,
            'top': top
        })
        setTimeout(function () {
            $('.popap_select').fadeIn(500);
        }, 500);


        $('.fon').click(function () {
            $('.popap').fadeOut(500);
            $('.popap').css('z-indez',-1)
            setTimeout(function () {
                $('.fon').fadeOut(500)
            }, 500)
        })
        $('.popap').click(function (e) {
            e.stopPropagation();
        })

    })
    $('.open_record').click(function () {
        $('.fon').fadeIn(500);
        $('.popap_record').css({
            'opacity': 0,
            'display': 'block'
        })
        var left = ($(window).outerWidth() - $('.popap_record').outerWidth()) / 2;
        var top = ($(window).outerHeight() - $('.popap_record').outerHeight()) / 2;
        if (top < 0) {
            top = 0;
        }
        $('.popap_record').css({
            'opacity': 1,
            'display': 'none',
            'left': left,
            'top': top
        })
        setTimeout(function () {
            $('.popap_record').fadeIn(500);
        }, 500);


        $('.fon').click(function () {
            $('.popap').fadeOut(500);
            $('.popap').css('z-indez',-1)
            setTimeout(function () {
                $('.fon').fadeOut(500)
            }, 500)
        })
        $('.popap').click(function (e) {
            e.stopPropagation();
        })
    })
    $('.open_time').focus(function () {
        time_input = $(this);

        $('.time_popap').css({
            'opacity': 0,
            'display': 'block'
        })
        var left = ($(window).outerWidth() - $('.time_popap').outerWidth()) / 2;
        var top = ($(window).outerHeight() - $('.time_popap').outerHeight()) / 2;
        if (top < 0) {
            top = 0
        }
        $('.time_popap').css({
            'opacity': 1,
            'display': 'none',
            'left': left,
            'top': top
        })
        setTimeout(function () {
            $('.time_popap').fadeIn(500);
        }, 500);


        $('.fon').click(function () {
            $('.popap').fadeOut(500);
            $('.popap').css('z-indez',-1)
            setTimeout(function () {
                $('.fon').fadeOut(500)
            }, 500)
        })
        $('.popap').click(function (e) {
            e.stopPropagation();
        })
    })
    $('#down').click(function () {
        var top = $('.section_about').offset().top-$('.header').outerHeight();
        $('html, body').animate({scrollTop: top}, 800);
    })
    $('.check_block').click(function () {
        if ($(this).hasClass('check')) {
            $(this).removeClass('check')
        }
        else {
            $(this).addClass('check')
        }
    })
    $('#submit2').click(function () {
        $('.input_wrap').find('.input_line').find('input').each(function (el) {
            var val = $(this).val();
            var test = val.length;
            if (val === "") {
                $(this).parents('.input_line').addClass('error');
                $(this).parents('.input_line').find('.error_masege').slideDown(300)
            }
        })
        var flag = $('.input_wrap').find('.error').length;
        if (flag > 0) {
            return false;
        }
        else {
            $('.thanks_popap').css({
                'opacity': 0,
                'display': 'block'
            })
            var left = ($(window).outerWidth() - $('.thanks_popap').outerWidth()) / 2;
            var top = ($(window).outerHeight() - $('.thanks_popap').outerHeight()) / 2;
            if (top < 0) {
                top = 0;
            }
            $('.thanks_popap').css({
                'opacity': 1,
                'display': 'none',
                'left': left,
                'top': top
            })
            $('.popap_record').fadeOut(500);
            setTimeout(function () {
                $('.thanks_popap').fadeIn(500);
            }, 500);
        }


    })
    $('.input_line').find('input').click(function () {
        $(this).parents('.input_line').removeClass('error');
        $(this).parents('.input_line').find('.error_masege').slideUp(300)
    })
    $('.close').click(function () {
        $(this).parents('.popap').fadeOut(500);
        setTimeout(function () {
            $('.fon').fadeOut(500)
        }, 500)
    })
    $('.close2').click(function () {
        $('.time_popap').fadeOut(500)
    })
    var height = $('.header').outerHeight()
    $('.section').css('margin-top', height);
    $(window).resize(function () {
        var height = $('.header').outerHeight()
        $('.section').css('margin-top', height);
        return
    })
    if (win_w < 1601) {
        var flag=$('.action_slider').length;
       if(flag>0){
         setTimeout(function () {
             $('.action_slider').slick({
                 slidesToShow: 3,
                 slidesToScroll: 1,
                 prevArrow: ' <a href="javascript:void(0)" class="arrow prev_slide"></a>',
                 nextArrow: ' <a href="javascript:void(0)" class="arrow next_slide"></a>',
                 autoplay: false,
                 pauseOnHover: true,
                 responsive: [
                     {
                         breakpoint: 1200,
                         settings: {
                             slidesToShow: 2,
                         }
                     },



                 ]
             })
         },600)
       }
    }
    $('#left_menu').find('.parent').click(function () {
        if ($(this).hasClass('open')) {
            $(this).removeClass('open')
            $(this).find('.pod_menu').slideUp(300)
        }
        else {
            $('#left_menu').find('.open').find('.pod_menu').slideUp(300);
            $('#left_menu').find('.open').removeClass('open')
            $(this).addClass('open')
            $(this).find('.pod_menu').slideDown(300)
        }
    })
    $('.menu_line').find('.sandwich').click(function () {
        if ($('.menu_line').hasClass('open_menu')) {
            $('.sandwich').addClass('collapsed');
            $('.menu_line').removeClass('open_menu')
        }
        else {
            $('.sandwich').removeClass('collapsed');
            $('.menu_line').addClass('open_menu')
        }
    })
    $('.open_map').find('a').click(function () {
        $('.lessons_map').removeClass('small_map');
    })
    $('.close_map').find('a').click(function () {
        $('.lessons_map').addClass('small_map');
    })
    $('.checkbox').click(function () {
        if ($(this).hasClass('check')) {
            $(this).removeClass('check');
            return false;
        }
        else {
            $(this).addClass('check');
            return false;
        }
    })
    $('.select_line,.dop_filter_line').find('.select').click(function () {
        $('.select_line').find('.open').removeClass('open');
        $(this).addClass('open')
    })
    $('#reset').click(function () {
        $('.checkbox_line').find('.check').removeClass('check');
    })
    $('.open_dop_filter').find('a').click(function () {
        if ($(this).hasClass('open')) {
            $(this).removeClass('open');
            $('.dop_filter').slideUp(300);
        }
        else {
            $(this).addClass('open');
            $('.dop_filter').slideDown(300);
        }
    })

    $('.open_text').click(function () {
        if ($('.hidden_text').is(":hidden")) {
            $('.hidden_text').slideDown(300);
            $(this).html('Скрыть')
        }
        else {
            $('.hidden_text').slideUp(300);
            $(this).html('Подробнее...')
        }
    })
    setTimeout(function () {
        var src_f = $('iframe').attr('data-src');
        $('iframe').attr('src', src_f);
        $("img").each(function (index, el) {
            var top_w = $(el).offset().top;
            var scroll_t = $(window).scrollTop() + $(window).outerHeight();
            var src = $(el).attr('data-src');
            $(el).attr('src', src)

        })
        $('.loader').fadeOut(300);
    }, 1000)
    $(window).scroll(function () {
        var top = $(window).scrollTop();
        if (top > 0) {
            $('.header').addClass('fixed');
        }
        else {
            $('.header').removeClass('fixed');
        }
        return
    })
    var flag10=$('.linck_foto').length;
    if(flag10>0){
        $('.linck_foto').fancybox();
    }
    var flag4=$('.slider_foto').length;
  if(flag4>0){
     setTimeout(function () {
         $('.slider_foto').slick({
             slidesToShow: 3,
             slidesToScroll: 1,
             prevArrow: ' <a href="javascript:void(0)" class="arrow prev"></a>',
             nextArrow: ' <a href="javascript:void(0)" class="arrow next"></a>',
             responsive: [
                 {
                     breakpoint: 992,
                     settings: {
                         slidesToShow: 2,
                     }
                 },



             ]
         })
     },600)
  }

    function scroll() {

    }

    $(window).scroll(function () {
        $('.table_scroll').each(function (i, el) {
            var top = $(window).scrollTop() + $(window).outerHeight() - 100;
            var left =$('.table_scroll').find('table').outerWidth()- $('.table_scroll').outerWidth();
            var flag=0

            var top_el = $(this).offset().top;
                if (top > top_el) {
                $(el).animate({scrollLeft: left}, 2500);
                $(el).animate({scrollLeft: 0}, 2500);
                    setTimeout(function () {
                        $(el).clearQueue();
                        $(el).stop()
                    },5000)

            }
        })

        return
    })



}, 0)
$('.table_scroll').mouseenter(function () {
    $(this).clearQueue();
    $(this).stop()
})
$('.popap_graph').find('.table_scroll').click(function () {
    $(this).clearQueue();
    $(this).stop()
})
$('.table_scroll').click(function () {
    $(this).clearQueue();
    $(this).stop()
})