PageSourceSearch

https://asavto-exeed.ru/local/templates/exeed/js/custom.js

js asavto-exeed.ru collected 2026-09-24 12:07:09 UTC 12,903 bytes, 440 lines download raw bytes

1$(document).ready(function () {
2
3  if ($('.back-to-top').length) {
4      var scrollTrigger = 100, // px
5        backToTop = function () {
6            var scrollTop = $(window).scrollTop();
7            if (scrollTop > scrollTrigger) {
8                $('.back-to-top').addClass('show');
9            } else {
10                $('.back-to-top').removeClass('show');
11            }
12        };
13    backToTop();
14    $(window).on('scroll', function () {
15        backToTop();
16    });
17    $('.back-to-top').on('click', function (e) {
18        e.preventDefault();
19        $('html,body').animate({
20            scrollTop: 0
21        }, 700);
22    });
23  }
24
25
26
27  BX.ready(function () {
28    if (BX.admin) {
29      var MyPanel = BX("js-header"),
30        BxPanel = BX.admin.panel,
31        FxPanel = function () {
32          if (
33            window.pageYOffset >= BxPanel.DIV.clientHeight &&
34            BxPanel.isFixed() === false
35          ) {
36            MyPanel.style.top = 0;
37          } else if (BxPanel.isFixed() === true) {
38            MyPanel.style.top = BxPanel.DIV.clientHeight + "px";
39          } else {
40            MyPanel.style.top =
41              BxPanel.DIV.clientHeight - window.pageYOffset + "px";
42          }
43        };
44      if (!!MyPanel) {
45        FxPanel();
46        window.onscroll = FxPanel;
47        BX.addCustomEvent("onTopPanelCollapse", BX.delegate(FxPanel, this));
48        BX.addCustomEvent("onTopPanelFix", BX.delegate(FxPanel, this));
49      }
50    }
51  });
52
53 // $(".phone_mask").mask("0 (000) 000-00-00");
54  $(".modal").click(function () {
55    $("#thanksModal").removeClass("open");
56    $("#errorModal").removeClass("open");
57  $("#errorModal9").removeClass("open");
58  $("#errorModalobaz").removeClass("open");
59$("#errorphone").hide();
60  });
61
62  $("#form-modal .modal-close").click(function () {
63    $("#form-modal").removeClass("open");
64  });
65 $("#form-modal2 .modal-close").click(function () {
66    $("#form-modal2").removeClass("open");
67  });
68 $("#form-modal3 .modal-close").click(function () {
69    $("#form-modal3").removeClass("open");
70  });
71 $("#form-modal4 .modal-close").click(function () {
72    $("#form-modal4").removeClass("open");
73  });
74 $("#form-modal5 .modal-close").click(function () {
75    $("#form-modal5").removeClass("open");
76  });
77 $("#form-modal6 .modal-close").click(function () {
78    $("#form-modal6").removeClass("open");
79  });
80 $("#form-modal7 .modal-close").click(function () {
81    $("#form-modal7").removeClass("open");
82  });
83 $("#form-modal8 .modal-close").click(function () {
84    $("#form-modal8").removeClass("open");
85  });
86  $(".js-open-form-modal").click(function () {
87    $("#form-modal").addClass("open");
88  });
89  $(".js-open-form-modal2").click(function () {
90    $("#form-modal2").addClass("open");
91  });
92  $(".js-open-form-modal3").click(function () {
93    $("#form-modal3").addClass("open");
94  });
95  $(".js-open-form-modal4").click(function () {
96    $("#form-modal4").addClass("open");
97  });
98  $(".js-open-form-modal5").click(function () {
99    $("#form-modal5").addClass("open");
100  });
101  $(".js-open-form-modal6").click(function () {
102    $("#form-modal6").addClass("open");
103  });
104 $(".js-open-form-modal7").click(function () {
105    $("#form-modal7").addClass("open");
106  });
107 $(".js-open-form-modal8").click(function () {
108    $("#form-modal8").addClass("open");
109  });
110  $(".form").each(function () {
111
112    $(this).validate({
113 onkeyup: false,
114 onfocusout: false,
115   onclick: false,
116
117
118      rules: {
119        phone: {
120          required: true,
121          minlength: 18,
122        },
123
124      },
125 
126
127      errorPlacement: function (error, element) {
128$("#errorModalobaz").addClass("open") 
129		  },
130
131      submitHandler: function (form) {
132var phones= $(form).find("input[name=phone]").val();
133var zvonok= $(form).find("input[name=id]").val();
134var imya= $(form).find("input[name=name]").val();
135		  if    (!phones.toString().startsWith("9",4)    ) {
136
137   $("#errorModal9").addClass("open");
138		  } 
139		  else {    $.ajax({
140          url: form.action,
141          type: form.method,
142          data: $(form).serialize(),
143          success: function (data) {
144            if (data == 1) {
145              $(form).find("input[type=text], textarea").val("");
146              $("#form-modal").removeClass("open");
147   $("#form-modal2").removeClass("open");
148 $("#form-modal3").removeClass("open");
149 $("#form-modal4").removeClass("open");
150 $("#form-modal5").removeClass("open");
151 $("#form-modal6").removeClass("open");
152              $("#thanksModal").addClass("open");
153
154
155if (zvonok  == 'call' )   {
156ym(86217624,'reachGoal','zakaz-zvonka-sabit');
157window._txq = window._txq || [];
158_txq.push(['track', 'sending'])
159		  }	else if (zvonok  == 'credit' ) {
160ym(86217624,'reachGoal','credit-sabit')
161		  }
162else if (zvonok  == 'trade_in' ) {
163ym(86217624,'reachGoal','trade-in-sabit')
164		  }
165	else if (zvonok  == 'test_drive' ) {
166ym(86217624,'reachGoal','test-drive-sabit')
167		  }
168 	else if (zvonok  == 'strah' ) {
169ym(86217624,'reachGoal','strahovanie-sabit')
170		  }
171              console.log(data , 1111);
172
173
174
175            } else {
176              console.log(data, 2222);
177              $("#errorModal").addClass("open");
178            }
179          },
180        });
181			  }
182      },
183    });
184  });
185
186  $(".js-popup-link").click(function () {
187    $("#equipment").val($(this).data("equipment"));
188  });
189
190  $(".equipment .js-accordion-title").click(function () {
191    $(this).toggleClass("js-accordion-title_open");
192    $(this).parent("tr").next("tr").toggleClass("js-accordion-body_open");
193  });
194
195  $(".map-item").click(function () {
196    if ($("#js-header-burger").hasClass("header__burger_open")) {
197      $("#js-header-burger").removeClass("header__burger_open");
198      $("#js-header-menu").removeClass("header__menu_open");
199    } else {
200      $("#js-header-burger").addClass("header__burger_open");
201      $("#js-header-menu").addClass("header__menu_open");
202    }
203  });
204
205  $(".nouislider").each(function (i, elem) {
206    var slider = $(elem).find(".nouislider-connect");
207    var start = JSON.parse(slider.attr("data-start"));
208    var range = JSON.parse(slider.attr("data-range"));
209    var step = slider.attr("data-step")
210      ? JSON.parse(slider.attr("data-step"))
211      : 0;
212
213    noUiSlider.create($(slider).get(0), {
214      start: start,
215      connect: true,
216      step: step,
217      range: {
218        min: range[0],
219        max: range[1],
220      },
221    });
222
223    $(slider)
224      .get(0)
225      .noUiSlider.on("update", function (values, handle) {
226        var value = values[handle];
227        var str = Math.round(value) + "";
228
229        if (handle) {
230          $(elem)
231            .find('.input-display[data-name="to"] .val')
232            .html(str.replace(/(\d)(?=(\d\d\d)+([^\d]|$))/g, "$1 "));
233          $(elem).find('input[data-name="to"]').val(str).change();
234        } else {
235          $(elem)
236            .find('.input-display[data-name="from"] .val')
237            .html(str.replace(/(\d)(?=(\d\d\d)+([^\d]|$))/g, "$1 "));
238          $(elem).find('input[data-name="from"]').val(str).change();
239        }
240      });
241  });
242  $(".nouislider .edit").click(function () {
243    var slider = $(this).closest(".nouislider");
244    $(this).closest(".input-wrap").toggleClass("edit");
245    var min = Number(slider.find('input[data-name="from"]').val());
246    var max = Number(slider.find('input[data-name="to"]').val());
247    if (min && max) {
248      slider
249        .find(".nouislider-connect")
250        .get(0)
251        .noUiSlider.updateOptions({
252          start: [min, max],
253        });
254    }
255  });
256});
257 var helpers = {
258	addZeros: function (n) {
259		return (n < 10) ? '' + n : '' + n;
260	}
261};
262
263function sliderInit() {
264  var $slider = $('.slider-holder');
265  $slider.each(function() {
266    var $sliderParent = $(this).parent();
267    $(this).slick({
268      slidesToShow: 2,
269      slidesToScroll: 2,
270      dots: true,
271      infinite: true,
272 prevArrow: '<button class="slick-prev slick-arrow" aria-label="Previous" type="button" style=""></button>',
273 nextArrow: '<button class="slick-next slick-arrow" aria-label="Next" type="button" style=""></button>',
274      responsive: [
275        {
276          breakpoint: 767,
277          settings: {
278            adaptiveHeight: true,
279  slidesToShow: 1,
280      slidesToScroll: 1
281          }
282        }
283      ]
284    });
285
286    if ($(this).find('.item').length > 1) {
287      $(this).siblings('.slides-numbers').show();
288    }
289
290    $(this).on('afterChange', function(event, slick, currentSlide){
291      $sliderParent.find('.slides-numbers .active').html(helpers.addZeros(currentSlide/2 +1 ));
292    });
293 $(this).on('afterChange', function(event, slick, currentSlide){
294      $sliderParent.find('.slides-numbers2 .active').html(helpers.addZeros(currentSlide +1 ));
295    });
296    var sliderItemsNum = $(this).find('.slick-dots li').not('.slick-cloned').length;
297    $sliderParent.find('.slides-numbers .total').html(helpers.addZeros(sliderItemsNum));
298   var sliderItemsNum = $(this).find('.slick-dots li').not('.slick-cloned').length;
299    $sliderParent.find('.slides-numbers2 .total').html(helpers.addZeros(sliderItemsNum));
300	  if ($(this).find('.slick-arrow').length == 0){
301 $(this).siblings('.slides-numbers').hide();
302 $(this).siblings('.slides-numbers2').hide();
303$(this).find('.item').addClass('padright');
304	  }
305
306  });
307
308
309
310};
311
312sliderInit();
313$(document).ready(function(){
314  $(".menusvoistva").on("click","a", function (event) {
315  event.preventDefault();
316  var id = $(this).attr('href'),
317  top = $(id).offset().top;
318  $('body,html').animate({scrollTop: top}, 100);
319  });
320});
321
322var $sections = $('.razdellx');
323var section_position = {}; //тут храним все верхние точки наших section
324var screen_height = $(window).height(); //высота видимой страницы
325
326checkPosition();
327
328$(window).resize(function(){
329  checkPosition();
330});
331
332function checkPosition(){
333  screen_height = $(window).height();
334
335  $sections.each(function(i, el) {
336    section_position[i] = $(el).offset().top + 200;
337  });
338}
339
340function toggleActiveClass(id) {
341  $('a.active').removeClass('active');
342  $('a[href="#' + id + '"]').addClass('active');
343}
344
345$(window).scroll(function() {
346  var s_top = $(document).scrollTop() + screen_height ;
347
348  for (key in section_position) {
349
350    if (s_top >= section_position[key] || s_top <= section_position[key + 1]) {
351      var id = $($sections[key]).attr('id');
352      toggleActiveClass(id);
353    }
354
355  };
356
357});
358
359$("nav").on("click", "a", function(event) {
360  event.preventDefault();
361  id = $(this).attr('href');
362  var top = $(id).offset().top;
363  $('body,html').animate({
364    scrollTop: top
365  }, 800);
366});
367$(document).ready(function(){
368  $("#luxuryotk").click(function(){
369   $("#lxprestige").hide();
370    $("#lxluxury").show();
371  $([document.documentElement, document.body]).animate({
372        scrollTop: $("#lxluxurys").offset().top
373    },500);
374
375  });
376  $("#prestotk").click(function(){
377 $("#lxluxury").hide();
378  $("#lxprestige").show();
379$([document.documentElement, document.body]).animate({
380        scrollTop: $("#lxprestiges").offset().top
381    },500);
382
383  });
384
385});
386
387   
388$("#secondscreen").click(function() {
389    $([document.documentElement, document.body]).animate({
390        scrollTop: $("#kharakteristiki").offset().top
391    },500);
392});
393$("#testd").click(function() {
394    $([document.documentElement, document.body]).animate({
395        scrollTop: $("#komplekt").offset().top
396    },500);
397});
398(function(){
399  var cut = document.getElementsByClassName('news__title');
400  for( var i = 0; i < cut.length; i++ ){
401  if (cut[i].innerText.length > 29) {
402    cut[i].innerText = cut[i].innerText.slice(0,29) + '...';
403  }}
404})();
405window.addEventListener("DOMContentLoaded", function() {
406    [].forEach.call( document.querySelectorAll('.phone_mask'), function(input) {
407    var keyCode;
408    function mask(event) {
409        event.keyCode && (keyCode = event.keyCode);
410        var pos = this.selectionStart;
411       if (pos < 3) event.preventDefault();
412        var matrix = "+7 (___) ___ __ __",
413            i = 0,
414            def = matrix.replace(/\D/g, ""),
415            val = this.value.replace(/\D/g, ""),
416            new_value = matrix.replace(/[_\d]/g, function(a) {
417                return i < val.length ? val.charAt(i++) || def.charAt(i) : a
418            });
419        i = new_value.indexOf("_");
420        if (i != -1) {
421            i < 5 && (i = 3);
422            new_value = new_value.slice(0, i)
423        }
424        var reg = matrix.substr(0, this.value.length).replace(/_+/g,
425            function(a) {
426                return "\\d{1," + a.length + "}"
427            }).replace(/[+()]/g, "\\$&");
428        reg = new RegExp("^" + reg + "$");
429        if (!reg.test(this.value) || this.value.length < 5 || keyCode > 47 && keyCode < 58) this.value = new_value;
430        if (event.type == "blur" && this.value.length < 5)  this.value = ""
431    }
432
433    input.addEventListener("input", mask, true);
434    input.addEventListener("focus", mask, true);
435    input.addEventListener("blur", mask, true);
436    input.addEventListener("keydown", mask, true)
437
438  });
439
440});

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.