PageSourceSearch

https://www.kazan-guide.ru/wp-content/themes/kgru_n/js/common.js

js kazan-guide.ru collected 2026-10-02 12:06:05 UTC 11,000 bytes, 436 lines download raw bytes

1jQuery(function($) {
2
3    /*
4      Адаптивное меню
5    */
6
7    $('.nav-toggle').click(function() {
8        $('.nav').toggleClass('nav_mobile');
9        $('.nav-toggle').toggleClass('nav-toggle_active');
10    });
11
12    var pull    = $('.nav-toggle'),
13      menu    = $('.menu'),
14      menuHeight  = menu.height();
15
16    $(pull).on('click', function(e) {
17      e.preventDefault();
18      menu.slideToggle();
19    });
20
21    // $(window).resize(function(){
22    //   var w = $(window).width();
23    //   if(w > 320 && menu.is(':hidden')) {
24    //     menu.removeAttr('style');
25    //   }
26    // });
27
28
29	$('#star-rating').rating();
30	/*
31	$(document).on("click", ".searchbtn__btn", function(){
32		var goalParams = {
33			button:'found_booking'
34		};
35		alert(1);
36		yaCounter6363202.reachGoal('go_booking', goalParams);
37		return true;
38	});
39	*/
40	
41	$("a.bron1").on("click", function(){
42		var goalParams = {
43			button:'zabronirovat_booking'
44		};
45		yaCounter6363202.reachGoal('go_booking',goalParams);
46		return true;
47	});
48	
49	$("a.bron2").on("click", function(){
50		var goalParams = {
51			button:'see_more_booking'
52		};
53		yaCounter6363202.reachGoal('go_booking',goalParams);
54		return true;
55	});
56
57	
58	$("a.bron3").on("click", function(){
59		var goalParams = {
60			button:'excursiya'
61		};
62		yaCounter6363202.reachGoal('excurs_zakaz',goalParams);
63		return true;
64	});
65	
66	$("button.exc-contact-form-btn").on("click", function(){
67		var goalParams = {
68			button:'excursovod'
69		};
70		yaCounter6363202.reachGoal('excurs_zakaz',goalParams);
71		return true;
72	});
73
74
75
76
77
78    //tabs
79    $('#tabs, #tabs-3').on('click', 'li:not(.active)', function() {  
80        $(this).addClass('active').siblings().removeClass('active').parents('.routes, .entry, .where-stop').find('.box').eq($(this).index()).fadeIn(150).siblings('.box').hide();
81          $('.slider-items').slick('reinit');
82          //$('.slider-nav').slick('reinit');
83          //$('.slider-for').slick('reinit');
84    });
85    
86    //tabs
87    $('#tabs-2').on('click', 'li:not(.active)', function() {  
88        $(this).addClass('active').siblings().removeClass('active').parents('.param-item').find('.box-2').eq($(this).index()).fadeIn(150).siblings('.box-2').hide();  
89    });
90	
91    //tabs
92    $('#tabs, #tabs-3').on('touchstart', 'li:not(.active)', function() {  
93        $(this).addClass('active').siblings().removeClass('active').parents('.routes, .entry, .where-stop').find('.box').eq($(this).index()).fadeIn(150).siblings('.box').hide();
94          $('.slider-items').slick('reinit');
95          //$('.slider-nav').slick('reinit');
96          //$('.slider-for').slick('reinit');
97    });
98    
99    //tabs
100    $('#tabs-2').on('touchstart', 'li:not(.active)', function() {  
101        $(this).addClass('active').siblings().removeClass('active').parents('.param-item').find('.box-2').eq($(this).index()).fadeIn(150).siblings('.box-2').hide();  
102    });
103	
104    
105    //nav
106    
107    var navTop = $('.nav').position().top;
108    
109    $(window).scroll(function() {
110        // if ($(window).width() > 965) {
111            if ($(this).scrollTop() > navTop) {
112                $('.nav').addClass('fixed');
113            }
114            else {
115                $('.nav').removeClass('fixed');
116            }
117        // }
118        
119        
120    });
121    
122    //styler
123    $('.select-wrapper select, .currency select').styler();
124    
125    //slider
126    $('.slider-items').slick({
127        dots: false,
128        speed: 500,
129        slidesToShow: 3,
130        slidesToScroll: 3, 
131        arrows: true,
132        autoplay: true,
133        adaptiveHeight: true,
134        autoplaySpeed: 5000,
135        responsive: [
136            {
137              breakpoint: 947,
138              settings: {
139                slidesToShow: 1,
140                slidesToScroll: 1
141              }
142            }
143        ]
144    });
145    
146    //slider
147    $('.slider-items-2').slick({
148        dots: false,
149        speed: 500,
150        slidesToShow: 4,
151        slidesToScroll: 4, 
152        arrows: true,
153        autoplay: true,
154        adaptiveHeight: true,
155        autoplaySpeed: 5000,
156        responsive: [
157            {
158              breakpoint: 947,
159              settings: {
160                slidesToShow: 1,
161                slidesToScroll: 1
162              }
163            }
164        ]
165    });
166    
167    //slider
168    $('.slider-for').slick({
169        slidesToShow: 1,
170        slidesToScroll: 1,
171        arrows: false,
172        asNavFor: '.slider-nav'
173    });
174    
175    $('.slider-nav').slick({
176        slidesToShow: 3,
177        slidesToScroll: 1,
178        asNavFor: '.slider-for',
179        dots: false,
180        centerMode: true,
181        focusOnSelect: true,
182        responsive: [
183            {
184              breakpoint: 947,
185              settings: {
186                slidesToShow: 3,
187                slidesToScroll: 1
188              }
189            }
190        ]
191    });
192    
193	//slider
194    $('.slider-hotel-for').slick({
195        slidesToShow: 1,
196        slidesToScroll: 1,
197        asNavFor: '.slider-hotel-nav',
198		arrows: true,
199		focusOnSelect: true,
200		autoplay: true,
201		autoplaySpeed: 5000
202		
203    });
204    
205    $('.slider-hotel-nav').slick({
206        slidesToShow: 1,
207        slidesToScroll: 1,
208        asNavFor: '.slider-hotel-for',
209        centerMode: true,
210        focusOnSelect: true,
211		arrows: true
212    });
213	
214    //slider
215    $('.slider-single').slick({
216        slidesToShow: 1,
217        slidesToScroll: 1,
218        arrows: true,
219        autoplay: true,
220        autoplaySpeed: 10000
221    });
222    
223    $('.link-question').click(function(e) {
224        e.preventDefault();
225        if ($('.question').is(':visible')) {
226            $('.question').slideUp();
227        }
228        else {
229            $('.question').slideDown();
230        }
231        
232    });
233    
234    //valid
235    var pattern = /^[a-z0-9_-]+@[a-z0-9-]+\.[a-z]{2,6}$/i;
236    
237    $('form').submit(function(e) {
238        
239        if ($(this).find('.required').val() == '') {
240            e.preventDefault();
241            $(this).find('.required').each(function() {
242                $(this).addClass('error');
243                //.val('Заполните ' + $(this).attr('placeholder'));
244            });
245            
246        }
247        
248        /*
249        if($(this).find('.email').val().search(pattern) == 0){
250        	$(this).find('.email').removeClass('error');
251        }
252        else {
253        	$(this).find('.email').val('Неккоретно введен email');
254            $(this).find('.email').addClass('error');
255            e.preventDefault();
256        }
257        */
258        
259    });
260    
261    $('input[type=text], input[type=password], textarea').focus(function() {
262       $(this).removeClass('error');
263       //.val(''); 
264    });
265    
266    
267    //hide
268    $('.checkbox li').each(function() {
269        if ($(this).index() > 8) {
270            $(this).hide();
271        }
272    });
273    
274    $('.link-show').click(function(e) {
275        e.preventDefault();
276        
277        $(this).parent().find('li').each(function() {
278            //if ($(this).index() > 8) {
279                $(this).show();
280            //}
281        });
282        
283        $(this).hide();
284        
285    });
286    
287    // slider 
288    $('#slider-price').slider({
289        range: true,
290        animate:'slow',
291        values: [ $('#min').val(), $('#max').val() ],
292        min: 0,
293        max: 15000,
294        step: 100,
295        slide: function( event, ui ) {
296            $('#min').val(ui.values[ 0 ]);
297            $('#max').val(ui.values[ 1 ]);
298        }
299    });
300    
301    //$('#min').val($( "#slider-price" ).slider( "values", 0 ));
302    //$('#max').val($( "#slider-price" ).slider( "values", 1 ));
303    
304    //window
305    $('.link-license').click(function(e) {
306        e.preventDefault();
307        $('.window-license, .shadow').fadeIn();
308    });
309    
310    //window
311    $('.link-more').click(function(e) {
312        e.preventDefault();
313        $('.window-response, .shadow').fadeIn();
314    });
315    
316    //window
317    $('.shadow, .btn-close').click(function(e) {
318        e.preventDefault();
319        $('.window, .shadow').fadeOut();
320    });
321    
322    //window
323    $('.response a.more-btn').click(function(e) {
324        e.preventDefault();
325        $('.window-review, .shadow').fadeIn();
326    });
327    
328    
329    $('#star-comment').rating({
330		fx: 'full',
331        image: 'http://www.kazan-guide.ru/wp-content/themes/kg/img/stars.png',
332        loader: 'http://www.kazan-guide.ru/wp-content/themes/kg/img/ajax-loader.gif',
333        click: function(res){
334			$('#star-rating-hidden').val(res);
335        }
336	});
337    
338    //$(".tel").mask("+7 (999) 999-9999");
339    
340    $('.exc-contact-form').on('submit', function(){
341		if($('.usr-name').val() && $('.usr-tel').val()){
342			var data = {
343				'action': 'exc-contact',
344				'name': $('.usr-name').val(),
345				'email': $('.usr-email').val(),
346				'tel': $('.usr-tel').val(),
347				'msg': $('.usr-text').val(),
348				'exc_id': $('.usr-exc-id').val(),
349				'amail': $('.usr-email2').val()
350			};
351			$.post('/wp-content/themes/kgru/parts/mail.php' , data, function(response) {
352				if(response == 'mail'){alert('Укажите емейл');return false;}
353				alert('Ваше сообщение отправлено');
354				$('.exc-contact-form-btn').hide();
355			});
356			yaCounter6363202.reachGoal('excurs_zakaz');
357		}
358		
359		
360		return false;
361	});
362	
363	$('.jwp-submit').on('click', function(){
364		$(this).closest('form').submit();
365		return false;
366	});
367	
368	$(".btn btn-orange aflink").on("click", function(){
369var goalParams = {
370button:'zabronirovat_booking'
371};
372yaCounter6363202.reachGoal('go_booking',goalParams);
373return true;
374});
375
376	$('#do-order').on('change', function(){
377		var url = window.location.href;
378		url = url.replace(/orderby=rating/g, '');
379		url = url.replace(/orderby=date/g, '');
380		url = url.replace(/orderby=price/g, '');
381		var q = '';
382		if(!window.location.search) q = '?';
383		url = url+q+'&orderby='+$(this).val();
384		document.location.href = url;
385	});
386	
387	$('#show-more-comments').on('click', function(){
388		var data = {
389			'action': 'ajax_comments',
390			'page': $('#show-more-page').val(),
391			'post_id': $('#comments-post-id').val(),
392			'template': $('#comments-tpl').val(),
393		};
394
395		$.post('/wp-admin/admin-ajax.php', data, function(response) {
396			console.log(response);
397			if(response){
398				var page = $('#show-more-page').val();
399				page = parseInt(page) + 1;
400				$('#show-more-page').val(page);
401				$('#avatarcomments').append(response);
402			} else {
403				$('#show-more-comments').hide();
404			}
405		});
406		return false;
407	});
408	
409	$(document).on('click', '.comment-responce', function(){
410		var cid = $(this).attr('data-cid');
411		$('#comment_parent').val(cid);
412		var offset = $("#comment-response-form").offset().top - 60;
413		$('html, body').animate({
414			scrollTop: offset
415		}, 2000);
416		return false;
417	});
418	
419	$("#rand-exc-sidebar").stick_in_parent({
420		parent: $('.main-conteiner'),
421		offset_top: 90
422	});
423	var p = $('.rand-exc-container .compact-excursions'),
424        len = p.length,
425        indx = 0;
426    ! function go() {
427        p.eq(indx).fadeIn("slow", function() {
428            $(this).delay(5000).fadeOut("slow", go)
429        });
430        indx = ++indx % len
431    }();
432	
433});
434
435
436

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.