PageSourceSearch

https://bavaria-astana.kz/static/js/mini/main.js?v=149

js bavaria-astana.kz collected 2026-10-08 15:15:28 UTC 5,785 bytes, 236 lines download raw bytes

1$(document).ready(function () {
2
3	$(window).scroll(function(){
4		var t = $(window).scrollTop();
5		if(t>0) {
6
7			$('header').addClass('bg');
8		}	else {
9			$('header').removeClass('bg');
10			$('.dropdown-auto').removeClass('active');
11		}
12	});
13	
14	(function () {
15		$('a[href^="http"]').not('[href^="//mini.bavaria.kz"]').attr('target', '_blank');
16	})();
17
18	$('ul.tabs li').each(function () {
19		$(this).click(function () {
20			var tab_id = $(this).data('tab');
21
22			if (tab_id) {
23				$('#about ul.tabs li').removeClass('current');
24				$('.about-content').removeClass('current');
25
26				$('#dealers ul.tabs li').removeClass('current');
27				$('#dealers .content').removeClass('current');
28
29				$('#car-info ul.tabs li').removeClass('current');
30				$('#car-info .content').removeClass('current');
31
32				if ($('.lineup-slider').length) {
33					$('#models_slider .swiper-slide').appendTo('#models_hide');
34					$('#models_hide .' + tab_id).appendTo($('#models_slider .swiper-wrapper'));
35
36					$('ul.tabs li').removeClass('current');
37					$('.lineup-slider').removeClass('current');
38				}
39
40				$(this).addClass('current');
41				$("#" + tab_id).addClass('current');
42
43				if (tab_id == 'test-drive') {
44					$('p.test-drive').show();
45					$('p.get-offer').hide();
46				} else {
47					$('p.test-drive').hide();
48					$('p.get-offer').show();
49				}
50			}
51		});
52	});
53});
54
55
56// Активная ссылка страницы
57$(function () {
58	$('.nav-menu li a').each(function () {
59		// получаем адрес страницы
60		var location = window.location.href;
61		// получаем адрес ссылки
62		var link = this.href;
63
64		// при совпадении адреса ссылки и адреса окна
65		if (location == link) {
66			$(this).addClass('current_page');
67		} else {
68			$(this).removeClass('current_page');
69		}
70	});
71
72	$('.showPopupForm').click(function () {
73		var title = $(document).prop('title');
74		var url = window.location.href;
75		var subj = $(this).attr('id');
76		var promoId = $(this).data('promo');
77		var formTitle = $(this).data('title');
78		var note = $(this).data('note');
79
80		$.ajax({
81			url: '/mini/form/getPopupForm/',
82			type: 'post',
83			data: {
84				'title': title,
85				'url': url,
86				'promoId': promoId,
87				'subj': subj,
88				'formTitle': formTitle,
89				'note': note
90			},
91			success: function (data) {
92				if (!$('#popup').length) {
93					$('body').append(data);
94					$('#popup').fadeIn(200);
95				}
96			}
97		});
98
99		return false;
100	});	
101
102});
103
104// МОБИЛЬНОЕ МЕНЮ. ОТКРЫТЬ / ЗАКРЫТЬ
105$(function () {
106	$('.menu-icon').click(function () {
107		$('.nav-menu ul').show();
108		$('.menu-icon').hide();
109		$('.close').show();
110		
111		$('.lineup').show();
112		$('body').css({
113			'overflow': 'hidden'
114		});
115		$('header').addClass('active')
116	});
117
118	$('.close').click(function () {
119		$(this).hide();
120		$('.menu-icon').show();
121		$('.lineup').hide();
122		$('.nav-menu ul').hide();
123		$('body').css({
124			'overflow': 'auto'
125		});
126		$('.dropdown-auto, header').removeClass('active');
127
128	});
129
130});
131// ОТКРЫТЬ МОДЕЛЬНЫЙ РЯД
132$(function () {
133	if ($(window).width() > 1025) {
134		$(function() {
135				$('.dropdown-auto, .nav-menu').on('mouseenter',function (e) {
136					$(this).addClass('active');	
137					$('header').addClass('active');
138					 e.stopPropagation();
139				});
140
141				
142			$('.dropdown-auto').on('mouseleave',function (e) {
143					$(this).removeClass('active');	
144			});
145			$('.nav-menu').on("mouseleave", function(e) {
146				if ($(e.target).is(".nav-menu") === false) {
147					$("header").removeClass("active");
148					$('.dropdown-auto').removeClass('active');	
149				}
150			});
151			
152			$('.dropdown_item').mouseenter(function () {
153				$(this).find('.dropdown').addClass('active');
154					$(this).find('.main__link').addClass('active');
155					$('header').addClass('active');
156					$(this).addClass('active');
157
158				}).mouseleave(function () {
159					$(this).find('.dropdown').removeClass('active');
160					$(this).find('.main__link').removeClass('active');
161					$(this).removeClass('active');
162				});
163		});
164	}
165		
166
167
168	if ($(window).width() < 1025) {
169
170		$('header .logo-right').appendTo($('#lineup'));
171
172		$('.dropdown-auto, .nav-menu').unbind('mouseenter');
173		$('header, .nav-menu').unbind('mouseleave');
174		$(function() {
175			$('.dropdown-auto').on('click',function (e) {
176				$(this).toggleClass('active');
177				e.stopPropagation();
178			});
179		});
180
181		$('.nav-menu ul').scroll(function() {
182			if ($(this).scrollTop()>1 ) {
183				$('.close').hide();
184				$('header .logo').hide();
185			}
186			else {
187				$('.close').show();
188				$('header .logo').show();
189			}
190		});
191	}
192
193	if ($(window).width() < 640) {
194		$('.dropdown_item .main__link').click(function () {
195			$(this).parent().toggleClass('active');
196			$(this).parent().find('.dropdown').toggleClass('active');
197			console.log(this)
198		});
199		$('.categories a').click(function () {
200			$('.categories ul li:not(:first-child)').slideToggle(300);
201		});
202
203		$('#dealers li.current').click(function () {
204			$('#dealers ul li:not(:first-child)').slideToggle(300);
205		});
206
207		$('#car-info li.current').click(function () {
208			$('#car-info ul li:not(:first-child)').slideToggle(300);
209		});
210
211		$('#about li.current').click(function () {
212			$('#about ul li:not(:first-child)').slideToggle(300);
213		});
214	}
215
216});
217
218function toggleForm(vl) {
219	$('#form_service > p > span').removeClass('active');
220
221	if (vl == 'test-drive') {
222		$('#form_service > p > .test-drive').addClass('active');
223		if ($(window).width() < 1025)
224			$('#form_service > p').addClass('right');
225	} else {
226		$('#form_service > p > .getoffer').addClass('active');
227		if ($(window).width() < 1025)
228			$('#form_service > p').removeClass('right');
229	}
230
231	$('#subj').val(vl);
232	$('#service_form button[type=submit]').attr('id', vl + 'TargetBtn');
233	$('body,html').scrollTop($('#form_service').offset().top - 100);
234
235	return false;
vendor: 1 bytes, line 236
236}

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.