PageSourceSearch

https://styledent.ru/js/main.js?179057137012781

js styledent.ru collected 2026-09-28 14:15:14 UTC 12,781 bytes, 487 lines download raw bytes

1$(document).ready(function(){
2	var timer = $('.action-time');
3	var ajaxLock = false;
4
5	var $body = $('body');
6
7	$(document).on('click', '.ctx-e168-button[data-id="39234"]', function () {
8		ym(19273726,'reachGoal','other_click_callmobile')
9		console.log('other_click_callmobile')
10	})
11
12	$(document).on('submit', '.footer__subscribeForm', function () {
13		ym(19273726,'reachGoal','sale_novosti')
14		console.log('sale_novosti')
15	})
16
17	$(document).on('submit', 'form', function () {
18		ym(19273726,'reachGoal','all_leads')
19		console.log('all_leads')
20	})
21	
22	if (timer.length){
23		var timerDays = $('.action-time').find('.action_time__days span:first-child');
24		var timerHours = $('.action-time').find('.action_time__hours span:first-child');
25		var timerMinutes = $('.action-time').find('.action_time__minutes span:first-child');
26		var timerSeconds = $('.action-time').find('.action_time__seconds span:first-child');
27		var target_date = new Date();
28		target_date.setDate(target_date.getDate() + parseInt(timerDays.html()));
29		target_date.setHours(target_date.getHours() + parseInt(timerHours.html()));
30		target_date.setMinutes(target_date.getMinutes() + parseInt(timerMinutes.html()));
31		target_date.setSeconds(target_date.getSeconds() + parseInt(timerSeconds.html()));
32
33		var days, hours, minutes, seconds;
34
35		getCountdown();
36
37		setInterval(function () { getCountdown(); }, 1000);
38	}
39
40	function getCountdown(){
41		var current_date = new Date().getTime();
42		var seconds_left = (target_date - current_date) / 1000;
43
44		days = pad( parseInt(seconds_left / 86400) );
45		seconds_left = seconds_left % 86400;
46
47		hours = pad( parseInt(seconds_left / 3600) );
48		seconds_left = seconds_left % 3600;
49
50		minutes = pad( parseInt(seconds_left / 60) );
51		seconds = pad( parseInt( seconds_left % 60 ) );
52		timerDays.html(days);
53		timerHours.html(hours);
54		timerMinutes.html(minutes);
55		timerSeconds.html(seconds);
56	}
57
58	function pad(n) {
59		return (n < 10 ? '0' : '') + n;
60	}
61
62
63
64	$('.popular-services__tabs .popular-services-tab').click(function(e){
65		e.preventDefault();
66		var tab = $(this);
67		var tabs = $('.popular-services__tabs .popular-services-tab');
68		tabs.removeClass('active');
69		tab.addClass('active');
70		$('.popular-services__tabs-content .popular-services__tab-content').hide();
71		$('.popular-services__tabs-content #' + tab.data('for')).show();
72	});
73
74	$('.js-spec-detail-tab').click(function(e){
75		var $tab = $(this);
76		var index = $tab.index();
77		var $tabs = $('.doctor-detail__tabs .doctor-detail__tab');
78		
79		$('.js-spec-detail-tab').removeClass('active');
80		$tab.addClass('active');
81		
82		$('.doctor-detail__tab-content').removeClass('active');
83		$('.doctor-detail__tab-content:eq(' + index + ')').addClass('active');
84	});
85
86	var toggleMenu = function(e) {
87		var subsectionsBlock = $().find('.services-sidebar__item-subsections');
88		if (subsectionsBlock){
89			subsectionsBlock.slideToggle();
90		}
91	};
92
93	$('.services-sidebar__item').mouseenter(function(e){
94		var $subsectionsBlock = $(this).find('.services-sidebar__item-subsections');
95		if ($subsectionsBlock && $subsectionsBlock.is(':hidden')) {
96			$subsectionsBlock.slideDown();
97		}
98	}).mouseleave(function(e){
99		var $subsectionsBlock = $(this).find('.services-sidebar__item-subsections');
100		if ($subsectionsBlock && $subsectionsBlock.is(':visible')){
101			$subsectionsBlock.slideUp();
102		}
103	});
104	
105	$('.js-spec-works').twentytwenty({
106		before_label: 'До',
107		after_label: 'После',
108	});
109
110	$('.patients-reviews__wrapper').slick({
111		infinite: true,
112		slidesToShow: 2,
113		slidesToScroll: 1,
114		centerMode: true,
115		autoplay: true,
116		autoplaySpeed: 5000,
117
118		centerPadding: '10%',
119		prevArrow: '<div class="reviews_prevArrow reviews_arrows"></div>',
120		nextArrow: '<div class="reviews_nextArrow reviews_arrows"></div>',
121		responsive: [
122			{
123				breakpoint: 767,
124				settings: {
125					slidesToShow: 1,
126					slidesToScroll: 1,
127					centerPadding: '0',
128					variableWidth: false,
129					centerMode: false,
130					arrows: false
131				}
132			},
133
134		]
135	});
136	
137	$('.js-index-specs-slider').slick({
138		infinite: true,
139		slidesToShow: 3,
140		slidesToScroll: 1,
141		centerMode: true,
142		autoplay: true,
143		autoplaySpeed: 5000,
144
145		centerPadding: '10%',
146		prevArrow: '<div class="reviews_prevArrow reviews_arrows"></div>',
147		nextArrow: '<div class="reviews_nextArrow reviews_arrows"></div>',
148		responsive: [
149			{
150				breakpoint: 767,
151				settings: {
152					slidesToShow: 2,
153					slidesToScroll: 1,
154					centerPadding: '0',
155					variableWidth: false,
156					centerMode: false,
157					arrows: false
158				}
159			},		
160			{
161				breakpoint: 540,
162				settings: {
163					slidesToShow: 1,
164					slidesToScroll: 1,
165					centerPadding: '0',
166					variableWidth: false,
167					centerMode: false,
168					arrows: false
169				}
170			},
171
172		]
173	});	
174	
175	$('.js-faq-toggle').click(function() {
176		$(this).parent().toggleClass('faq-section_opened');
177	});
178
179	fncSlider(".example-slider", {
180		autoSlidingDelay: 5000,
181		blockASafterClick: true,
182	});
183
184	var $demoCont = document.querySelector(".demo-cont");
185
186	//document.querySelector(".demo-cont__credits-close").addEventListener("click", function() {
187	//    $demoCont.classList.remove("credits-active");
188	//});
189
190	//document.querySelector(".js-activate-global-blending").addEventListener("click", function() {
191	//    document.querySelector(".example-slider").classList.toggle("m--global-blending-active");
192	//});
193	//fncSlider(".fnc-slider", {autoSlidingDelay: 3000});
194
195	$('.popular-services__list.-mob').slick({
196		infinite: true,
197		slidesToShow: 1,
198		slidesToScroll: 1,
199		prevArrow: '<div class="popular_prevArrow popular_arrows"></div>',
200		nextArrow: '<div class="popular_nextArrow popular_arrows"></div>'
201	});
202	
203	$('.js-extend-service-list').click(function(e) {
204		$(this).closest('ul').find('.service-list__cut').toggleClass('service-list__cut_opened');
205	});
206	
207	$('.js-extend-service-hidden').click(function(e) {
208		e.preventDefault();
209	});
210	
211	$('.modal__overlay').click(function() {
212		$(this).parent().removeClass('modal_opened');
213	});
214	
215	$('.modal__wrapper').click(function(e) {
216		e.stopPropagation();
217	});
218	
219	$('.js-open-modal').click(function(e) {
220		e.preventDefault();
221		var $this = $(this);
222		var modalType = $this.data('modal');
223		var from = $this.data('title');
224		var $modal = $('.modal-window[data-type="' + modalType + '"]');
225		
226		if ($modal.length) {
227			$modal.addClass('modal_opened').find('.js-modal-from').val(from);
228			$modal.find('.js-field-from').val($this.data('from') || '');
229			
230			$('.js-contacts-slider', $modal).slick({
231				autoplay: true,
232				autoplaySpeed: 3000,
233				slideToShow: 1,
234				prevArrow: '<div class="reviews_prevArrow reviews_arrows"></div>',
235				nextArrow: '<div class="reviews_nextArrow reviews_arrows"></div>',
236			});				
237		}
238	});
239	
240	var $successModal = $('.modal-window[data-type="success"]');
241	$('.js-form-modal').submit(function(e) {
242		e.preventDefault();
243		var $this = $(this);
244		
245		$.ajax({
246			url: '/ajax/form.php?mode=appointment',
247			data: $this.serialize(),
248			success: function(response) {
249				if(response == 'false') {
250					$('.captcha-error').fadeIn()
251				} else {
252					ym(19273726,'reachGoal','lead_submit_appointment')
253					console.log('lead_submit_appointment')
254
255					$successModal.addClass("modal_opened");
256				}
257			}
258		});
259	});
260	
261	$('.js-banner-form').submit(function(e) {
262		e.preventDefault();
263		var $this = $(this);
264		
265		$.ajax({
266			url: '/ajax/form.php?mode=appointment',
267			data: $(this).serialize(),
268			success: function() {
269				ym(19273726,'reachGoal','lead_submit_appointment_banner')
270				console.log('lead_submit_appointment_banner')
271				$successModal.addClass("modal_opened");
272				$('.js-clearable', $this).val('');
273			}
274		});
275	});
276	
277
278	$('.js-expand-review').click(function(e) {
279		e.preventDefault();
280		var $this = $(this);
281		var $rev = $this.parent().find('.review-cut');
282		
283		if ($rev.hasClass('review-cut_opened')) {
284			$rev.removeClass('review-cut_opened')
285			$this.text('Читать полностью');
286		} else {
287			$rev.addClass('review-cut_opened')
288			$this.text('Свернуть');
289		}
290	});
291	
292	$('.gallery').masonry({
293		itemSelector: '.gallery__item',
294		columnWidth: 230,
295		gutter: 16,
296		horizontalOrder: true
297	});
298	
299	$('.js-mask-phone').mask("+7 (999) 999-99-99");
300	$('.js-mask-time').mask("99:99");
301	$('.js-mask-date').mask("99.99.9999");
302	$('.js-date-mask').mask("99.99.9999");
303	
304	$('.js-mobile-slider').slick({
305		slidesToScroll: 1,
306		slideToShow: 1,
307		infinite: true,
308		autoplay: true,
309		autoplaySpeed: 10000,
310		arrows: true,
311		dots: true
312	});
313	
314	$('.js-open-mobile-menu').click(function(e) {
315		$(this).toggleClass('mobile-menu__ham_opened');
316		$('.js-mobile-menu').toggleClass('mobile-menu__body_opened');
317		$('body').toggleClass('overflow-hidden');
318	});
319	
320	$('.js-expand-service-text').click(function(e) {
321		e.preventDefault();
322		$(this).next('.service-page__text-cut').removeClass('hidden');
323		$(this).remove();
324	});	
325	
326	if ($(".js-page-faq-trigger").length) {
327	  $(".js-page-faq-trigger").click(function () {
328		$(this).parent().toggleClass("faq-item_opened");
329	  });
330	}	
331	
332	new WOW().init();
333    
334	
335	function loadSpecs(showAll){
336
337		if (!ajaxLock) {
338			ajaxLock = true;
339
340			BX.showWait('js-specs-list');
341
342			var params = $('.js-spec-filter-form').serialize();
343
344			if (showAll) {
345				params = params + '&show_all=Y'
346			}
347
348			$.get('', params, function (data) {
349				$('.js-specs-list').html(data);
350				BX.closeWait('js-specs-list');
351				ajaxLock = false;
352			});
353		}
354	}	
355	
356    $('.js-spec-specialties').change(function(e){
357        location.href = '/doctors/' + (e.target.value ? e.target.value + '/' : '');
358    });
359	
360	$('.js-spec-filter-form').submit(function(e) {
361		e.preventDefault();
362	});	
363
364    $('.js-spec-fio').keyup(function(){
365        loadSpecs();
366
367        $.get('/ajax/form.php', {
368			action: 'spec_name_suggestion',
369			q: $(this).val()
370		}, function(data){
371        }, 'json');
372    });
373	
374	function filterResponses() {
375
376		if (!ajaxLock) {
377			ajaxLock = true;
378
379			BX.showWait('js-response-list');
380
381			var params = $('.js-response-filter-form').serialize();
382
383			$.get('', params, function (data) {
384				$('.js-response-list').html(data);
385				BX.closeWait('js-response-list');
386				ajaxLock = false;
387			});
388		}
389	}
390	
391	$('.js-price-show-items').click(function() {
392		$(this).toggleClass('price-section__header_active');
393	});	
394	
395	$('.js-custom-select-value').click(function() {
396		$(this).closest('.js-custom-select').toggleClass('custom-select_opened');
397	});
398	
399	$('.js-custom-select-list .custom-select__option').click(function() {
400		var $this = $(this);
401		var $select = $this.closest('.js-custom-select');
402		var textValue = $this.html();
403		var value = $this.data('value');
404		
405		$('.js-custom-select-field', $select).val(value);
406		$('.js-custom-select-value').html(textValue);
407		
408		$select.removeClass('custom-select_opened');
409	});
410	
411		
412	$('.js-switch-tab').click(function(e) {
413		e.preventDefault();
414		var $this = $(this);
415		var target = $this.data('for');
416		
417		$('.js-switch-tab').removeClass('form-tabs__tab_active');
418		$this.addClass('form-tabs__tab_active');
419		
420		$('.form-tabs-content__item').removeClass('form-tabs-content__item_active');
421		$('#' + target).addClass('form-tabs-content__item_active');
422		
423		$('.js-getting-type-field').val(target);
424	});
425	
426	var $body = $('body');
427	//$(window).scroll(function() {
428	//	$body.toggleClass('fixed-header', $(this).scrollTop() > 135);
429	//});	
430	
431	$('.js-spec-button-sign').click(function(e) {
432		e.preventDefault();
433		
434		var $scheduleTab = $('.js-spec-tab-button-schedule');
435		$scheduleTab.click();
436		
437		$('html, body').animate({ scrollTop: $scheduleTab.offset().top }, 500, 'swing');			
438	});	
439	
440	var currentPrimaryTab = 'after18';
441	$('.js-primary-tab').click(function() {
442		$('.primary-patient__tab').removeClass('primary-patient__tab_active');
443		
444		var primaryType = $(this).data('for');
445		$(this).addClass('primary-patient__tab_active');
446		$('#' + currentPrimaryTab).hide();
447		$('#' + primaryType).show();
448		
449		currentPrimaryTab = primaryType;
450	});
451	
452	if ($('.js-page-faq-trigger').length) {
453		$('.js-page-faq-trigger').click(function() {
454			$(this).parent().toggleClass('construct-page__faq-item_opened');
455		});
456	}	
457	
458	if ($('.js-construct-form').length) {
459		$('.js-construct-form').submit(function(e) {
460			e.preventDefault();
461			
462			$.ajax('/ajax/form.php?mode=hospital_form', {
463				method: 'POST',
464				data: $(this).serialize(),
465				success: function(res) {
466					if (res == 1) {
467						$('.js-construct-form-body').addClass('construct-page__forms-appointment-result').html('Заявка принята');
468					} else {
469						alert('Ошибка при отправке заявки');
470					}
471				}
472			});			
473		});
474	}
475
476	$('.js-switch-payer-same').change(function(e) {
477		var v = +$(this).val();console.log(v);
478		
479		$('.js-tax-request-fields')
480			.toggleClass('d-none', v === 1)
481			.find('.js-need-required')
482			.attr('required', v !== 1);
483	});	
484
485
486
487});

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.