$(function () { $('.mask-phone').mask('+ 7 (000)-000-00-00'); /* $(function() {$(window).scroll(function() {if($(this).scrollTop() != 0) {console.log($(this).scrollTop());}else {console.log($(this).scrollTop());}});}); */ $(window).scroll(function () { if ($(window).scrollTop() >= 300) { $('.header').addClass('fixed'); $('.main').addClass('fixed'); } else { $('.header').removeClass('fixed'); $('.main').removeClass('fixed'); } }); if ($(window).width() < 1023) { $('.main-list > li > a').click(function () { $(this).next().toggleClass('open'); }); $('.main-list > li > a').click(function () { $(this).toggleClass('active'); }); //$('.dropdown-menu.lvl1 > li > a').click(function() { $(this).next().addClass('open'); }); //$('.dropdown-menu.lvl1 > li:first-child').click(function() { $(this).parent().removeClass('open'); }); //$('.dropdown-menu.lvl2 > li:first-child').click(function() { $(this).parent().removeClass('open'); }); } $("form:not(.form-review)").submit(function () { $(this).find('button[type="submit"]').prop('disabled', true); $(this).find('button[type="submit"]').addClass('refreshButton'); setTimeout(function () { $('.refreshButton').prop('disabled', false); $('.refreshButton').removeClass('refreshButton'); }, 2500); $.ajax({ type: "POST", url: "/netcat/add.php", dataType: "html", nameFunction: "request", data: $(this).serialize(), cache: false, success: function (response) { $('.result_wrapper').html(response); $('.modal-close').trigger('click'); $('.sended_btn').trigger('click'); }, error: function (response) { $('.result_wrapper').html(response); $('.modal-close').trigger('click'); $('.sended_btn').trigger('click'); } }); return false; }); $(".form-review").submit(function () { $(this).find('button[type="submit"]').prop('disabled', true); $(this).find('button[type="submit"]').addClass('refreshButton'); setTimeout(function () { $('.refreshButton').prop('disabled', false); $('.refreshButton').removeClass('refreshButton'); }, 2500); $.ajax({ type: "POST", url: "/add_otzyv.php", dataType: "html", nameFunction: "request", data: $(this).serialize(), cache: false, success: function (response) { $('.result_wrapper').html(response); $('.modal-close').trigger('click'); $('.sended_btn').trigger('click'); }, error: function (response) { $('.result_wrapper').html(response); $('.modal-close').trigger('click'); $('.sended_btn').trigger('click'); } }); return false; }); // CUSTOM SELECT $(".js-select").select2(); // ADAPTIVE MENU $('.hamburger').click(function () { $(this).toggleClass('is-active'); $('.main-nav').toggleClass('open'); $('html').toggleClass('hidden'); }); $(window).scroll(function () { if ($(window).scrollTop() >= 300) { $('.header').addClass('fixed'); $('.main').addClass('fixed'); $('.logo-fixed').addClass('logo-now'); } else { $('.header').removeClass('fixed'); $('.main').removeClass('fixed'); $('.logo-fixed').removeClass('logo-now'); } }); // SCROLL TO ANY SECTION $('.scroll[href*="#"]').on('click', function (e) { e.preventDefault(); $('html, body').animate({ scrollTop: $($(this).attr('href')).offset().top }, 500, 'linear'); }); // TABS JQUERY $(".tab_item").not(":first").hide(); $(".wrapper .tab").click(function () { $(".wrapper .tab").removeClass("active").eq($(this).index()).addClass("active"); $(".tab_item").hide().eq($(this).index()).fadeIn() }).eq(0).addClass("active"); // MODAL MAGNIFIC POPUP INIT $('.modal-init').magnificPopup({ type: 'inline', fixedContentPos: true, removalDelay: 500, callbacks: { beforeOpen: function () { this.st.mainClass = this.st.el.attr('data-effect'); } }, midClick: true }); $('.close__modal').on("click", function () { $.magnificPopup.close(); }); /* $(window).on('resize', function () { $('.services-block').slick('resize'); $('.spec .row').slick('resize'); $('.license-img').slick('resize'); $('.price .row').slick('resize'); $('.c-features__row').slick('resize'); }); */ $(".city__filter").keyup(function () { var _this = this; var _text = $(this).val(); if (_text === "") { $(this).parent().parent().find('.non_active_city').addClass('hide'); $(this).parent().parent().find('.inside_city').removeClass('hide'); $(this).parent().parent().find('.million_city').removeClass('hide'); } else { $(this).parent().parent().find('.non_active_city').addClass('hide'); $(this).parent().parent().find('.inside_city').addClass('hide'); $.each($(".non_active_city"), function () { if ($(this).text().toLowerCase().indexOf($(_this).val().toLowerCase()) === -1) { } else { $(this).removeClass('hide'); } }) $.each($(".inside_city"), function () { if ($(this).text().toLowerCase().indexOf($(_this).val().toLowerCase()) === -1) { } else { $(this).removeClass('hide'); } }); } }); $(".c__filter").keyup(function () { var _this = this; var _text = $(this).val(); if (_text === "") { $(this).parent().find('.non_active_city').addClass('hide'); $(this).parent().find('.inside_city').removeClass('hide'); $(this).parent().find('.million_city').removeClass('hide'); } else { $(this).parent().parent().find('.non_active_city').addClass('hide'); $(this).parent().parent().find('.inside_city').addClass('hide'); $.each($(".non_active_city"), function () { if ($(this).text().toLowerCase().indexOf($(_this).val().toLowerCase()) === -1) { } else { $(this).removeClass('hide'); } }) $.each($(".inside_city"), function () { if ($(this).text().toLowerCase().indexOf($(_this).val().toLowerCase()) === -1) { } else { $(this).removeClass('hide'); } }); } }); $(".select_city").click(function () { $.ajax({ type: "POST", url: "/ajax/", data: { "city": '1' }, cache: false, success: function (data) { $(".city-list").html(data); } }); }); $(".select_city-sub").click(function () { $.ajax({ type: "POST", url: "/ajax/", data: { "city": '2', "send_url": $(location).attr('href') }, cache: false, success: function (data) { $(".city-list").html(data); } }); }); }); // new WOW().init({mobile: false,offset: -10000}); $(function () { $('.owl-carousel2').owlCarousel({ loop: true, margin: 10, nav: true, dots: false, autoplay: false, responsive: { 0: { items: 1 }, 600: { items: 2 }, 1000: { items: 4 } } }); $('.owl-carousel36').owlCarousel({ loop: true, margin: 10, nav: true, dots: false, autoplay: false, responsive: { 0: { items: 1 }, 600: { items: 2 }, 1000: { items: 4 } } }); $('.owl-carousel38').owlCarousel({ loop: true, margin: 10, nav: true, dots: false, autoplay: false, responsive: { 0: { items: 1 }, 600: { items: 2 }, 1000: { items: 3 } } }); $('.owl-carousel-review').owlCarousel({ loop: true, margin: 10, nav: true, dots: false, autoplay: false, responsive: { 0: { items: 1 }, 600: { items: 2 }, 1000: { items: 2 } } }); $('.owl-carousel-gallery').owlCarousel({ loop: true, margin: 10, nav: true, dots: false, autoplay: false, responsive: { 0: { items: 1 }, 600: { items: 1 }, 1000: { items: 1 } } }); $(".accordion__title").on("click", function (e) { e.preventDefault(); var $this = $(this); if (!$this.hasClass("accordion-active")) { $(".accordion__content").slideUp(400); $(".accordion__title").removeClass("accordion-active"); $('.accordion__arrow').removeClass('accordion__rotate'); } $this.toggleClass("accordion-active"); $this.next().slideToggle(); $('.accordion__arrow', this).toggleClass('accordion__rotate'); }); });