$(document).ready(function() { /********************** zooming ********************/ $('a[href="#zoom"]').click(function(){ if($('body').attr('class')){ $('body').removeClass('zoom'); $(this).html('ДЛЯ СЛАБОВИДЯЩИХ'); } else{ $('body').addClass('zoom'); $(this).html('ОБЫЧНАЯ ВЕРСИЯ'); } console.log('zooming'); return false; }); ////////////////////////////////////////////////// $('[data-toggle="tooltip"]').tooltip(); ////////////////////////////////////////////////// $('#map_contacts_wrapper').height($('#map_contacts_wrapper').width()); $('#map_shadow').height($('#map_shadow').width()); $('#map_contacts_canvas').height($('#map_contacts_canvas').width()); ////////////////////////////////////////////////// new WOW().init(); ////////////////////////////////////////////////// $(".navbar-nav > li > a").hover(function() { $( ".navbar-nav > li > a" ).each(function( index ) { $('.navbar-nav > li > a').stop( true, true ).fadeTo( "fast" , 0.5, function() {}); }); $(this).addClass("activeLink"); }, function() { $( ".navbar-nav > li > a" ).each(function( index ) { $('.navbar-nav > li > a').stop( true, true ).fadeTo( "fast" , 1, function() {}); }); $(this).removeClass("activeLink"); }); ////////////////////////////////////////////////// $('.galery').fancybox({ helpers: { overlay: { locked: false } } }); ////////////////////////////////////////////////// $("input[name='phone']").each(function( index ) { $(this).mask("+7 (999) 999-9999"); }); ////////////////////////////////////////////////// $('.order_button').click(function(e){ $('#_call').lightbox_me({ // modalCSS: {top: '50%', marginTop: '-150px'}, }); e.preventDefault(); }) $('.order_button').click(function(e){ $('#_call').lightbox_me({ // modalCSS: {top: '50%', marginTop: '-150px'}, }); e.preventDefault(); }) $('.winClose').trigger('close'); ////////////////////////////////////////////////// $('.news-slider').owlCarousel({ lazyLoad : true, loop: true, nav: false, responsive: false, navigation : true, navigationText : ["",""], rewindNav : true, scrollPerPage : false, responsive:{ 0:{ items:1 }, 600:{ items:2 }, 1000:{ items:4 }, 1200:{ items:6 } } }) ////////////////////////////////////////////////// // Go to the next item $('#part-nav-r').click(function() { $('#partSlide').trigger('next.owl.carousel'); }) // Go to the previous item $('#part-nav-l').click(function() { $('#partSlide').trigger('prev.owl.carousel'); }) ////////////////////////////////////////////////// $( ".vakansii" ).click(function() { $(this).find('.hiddable').slideToggle( "fast", function() { }); if ($(this).find('i').hasClass('fa-chevron-up')){ // alert('1'); $(this).find('i').switchClass('fa-chevron-up', 'fa-chevron-down'); } else { $(this).find('i').switchClass('fa-chevron-down', 'fa-chevron-up'); } }); ////////////////////////////////////////////////// // $(function() { // $( "#from" ).datepicker({ // defaultDate: "+1w", // changeMonth: true, // numberOfMonths: 1, // dateFormat: 'dd.mm.yy', // onClose: function( selectedDate ) { // $( "#to" ).datepicker( "option", "minDate", selectedDate ); // } // }); // $( "#to" ).datepicker({ // defaultDate: "+2w", // changeMonth: true, // numberOfMonths: 1, // dateFormat: 'dd.mm.yy', // onClose: function( selectedDate ) { // $( "#from" ).datepicker( "option", "maxDate", selectedDate ); // } // }); // }); var currentDate = new Date(new Date().getTime() - 30 * 24 * 60 * 60 * 1000); // var day = currentDate.getDate() // var month = currentDate.getMonth() + 1 // var year = currentDate.getFullYear() // console.log(currentDate); session_news_from = ".."; session_news_to = ".."; if ( session_news_from === "") { $("#from").datepicker({dateFormat: 'dd.mm.yy'}).datepicker("setDate", new Date(new Date().getTime() - 30 * 24 * 60 * 60 * 1000)); $('#to').datepicker({dateFormat: 'dd.mm.yy'}).datepicker("setDate", new Date('dd.mm.yy')+14); //$('#to').datepicker({dateFormat: 'dd.mm.yy'}).datepicker("setDate", new Date('01.03.16')); }else{ $("#from").datepicker({dateFormat: 'dd.mm.yy'}).datepicker("setDate", new Date(session_news_from)); $('#to').datepicker({dateFormat: 'dd.mm.yy'}).datepicker("setDate", new Date(session_news_to)); } $.datepicker.regional['ru'] = { closeText: 'Закрыть', prevText: '<Пред', nextText: 'След>', currentText: 'Сегодня', monthNames: ['Январь','Февраль','Март','Апрель','Май','Июнь', 'Июль','Август','Сентябрь','Октябрь','Ноябрь','Декабрь'], monthNamesShort: ['Янв','Фев','Мар','Апр','Май','Июн', 'Июл','Авг','Сен','Окт','Ноя','Дек'], dayNames: ['воскресенье','понедельник','вторник','среда','четверг','пятница','суббота'], dayNamesShort: ['вск','пнд','втр','срд','чтв','птн','сбт'], dayNamesMin: ['Вс','Пн','Вт','Ср','Чт','Пт','Сб'], dateFormat: 'dd.mm.yy', firstDay: 1, isRTL: false }; $.datepicker.setDefaults($.datepicker.regional['ru']); $('input.datepicker').datepicker({ showOn: 'both', buttonImageOnly: true, buttonImage: '/images/026.png' }); ////////////////////////////////////////////////// $(window).scroll(function() { var windscroll = $(window).scrollTop(); if (windscroll >= 1000) { $('.button-up').fadeIn('fast'); } else { $('.button-up').fadeOut('fast'); } }).scroll(); ////////////////////////////////////////////////// $('.button-up').click(function(e){ e.preventDefault(); var scrollPoint = $('body').offset().top; $('body,html').animate({ scrollTop: scrollPoint }, 1000); }) ////////////////////////////////////////////////// $('.sendMail').submit(function( event ) { event.preventDefault(); $.ajax({ type: 'GET', data: decodeURI($(this).serialize()), url: "/scripts/send.php", cache: false, success: function(msg){ // alert(msg); successMessage(); } }); }); ////////////////////////////////////////////////// $('.news__nav_category li').click(function(){ // alert(1); $(".news__nav_category li").each(function() { $(".news__nav_category li").removeClass( "news-act" ); }); $(this).addClass( "news-act" ); }) ////////////////////////////////////////////////// $('#findNew, .news__nav_category li').click(function(){ var send_from = $('#from').val(); var send_to = $('#to').val(); var event_type = $(".news__nav_category li.news-act").attr("id"); // alert(event_type); $('.news-load .news__content').fadeOut(300, function(){}); $.ajax({ type: 'GET', data: '&from='+send_from+'&to='+send_to+'&type='+event_type, url: "/bitrix/templates/alabin/components/bitrix/news/events/bitrix/news.list/.default/template.php?ajax=Y", cache: false, success: function(msg){ $(".news-preloader").fadeIn(); $(".news-load .news__content").html(msg).fadeIn(500); $('.news-slider').owlCarousel({ lazyLoad : true, loop: true, nav: false, responsive: false, navigation : true, navigationText : ["",""], rewindNav : true, scrollPerPage : false, responsive:{ 0:{ items:1 }, 600:{ items:2 }, 1000:{ items:4 }, 1200:{ items:6 } } }) } }); }); ////////// КОЛЕКЦИИ МЕНЮ ////////// var url = document.location.toString().toLowerCase(); var category = url.split("kollektsii/"); if (category.length > 1){ var category = category[1].split("?"); $('a[href$="' + category[0] + '"]').parents().css('display','block'); $('a[href$="' + category[0] + '"]').addClass('active'); } ////////////////////////////////////////////////// }); function successMessage(){ $( ".mail-success" ).slideDown( "slow", function() {}); setTimeout(function(){ $('.mail-success').slideUp(); }, 3000); } function initialize() { myCenMap = new google.maps.LatLng(53.192759, 50.109099); var mapOptions = { center: myCenMap, zoom: 14, panControl: false, zoomControl: false, draggable: true, scaleControl: false, scrollwheel: false, mapTypeControl: false, streetViewControl: false, zoomControlOptions: { style: google.maps.ZoomControlStyle.SMALL }, mapTypeId: google.maps.MapTypeId.ROADMAP }; var styles = [ { stylers: [ { hue: "#000" }, { saturation: -100 }, ] },{ featureType: "road", elementType: "geometry", stylers: [ { lightness: 100 }, { visibility: "on" }, ] },{ featureType: "road", elementType: "labels", stylers: [ { visibility: "on" } ] },{ featureType: "poi", featureType: "poi.business", featureType: "poi.government", featureType: "poi.medical", featureType: "poi.place_of_worship", featureType: "poi.school", featureType: "poi.sports_complex", stylers: [ { visibility: "off" }, ] },{ featureType: "transit", stylers: [ { visibility: "off" }, ] }, ]; var map = new google.maps.Map(document.getElementById("map_contacts_canvas"), mapOptions); map.setOptions({styles: styles}); //////// СОЗДАЕМ INFOWINDOW //////// var infoWindow = new google.maps.InfoWindow({ content: '

СОИКМ им. П. В. Алабина
ул.Ленинская, 142

' }); var infoWindowFrunze = new google.maps.InfoWindow({ content: '

Музей М.В. Фрунзе
ул. Фрунзе, 114

' }); var infoWindowLenin = new google.maps.InfoWindow({ content: '

Музей В.И. Ленина
ул. Ленинская, 131

' }); var infoWindowModern = new google.maps.InfoWindow({ content: '

Музей Модерна
ул. Фрунзе, 159

' }); //////// ВЫВОДИМ МАРКЕРЫ //////// var M1 = new google.maps.Marker({ position: new google.maps.LatLng(53.192759, 50.109099), map: map, title: '', animation: google.maps.Animation.DROP, optimized: false, zIndex: 9999, icon: '/images/marker.png' }); var M2 = new google.maps.Marker({ position: new google.maps.LatLng(53.191402, 50.093656), map: map, title: '', animation: google.maps.Animation.DROP, optimized: false, zIndex: 9999, icon: '/images/marker2.png' }); var M3 = new google.maps.Marker({ position: new google.maps.LatLng(53.192716, 50.110678), map: map, title: '', animation: google.maps.Animation.DROP, optimized: false, zIndex: 9999, icon: '/images/marker2.png' }); var M4 = new google.maps.Marker({ position: new google.maps.LatLng(53.194245, 50.096296), map: map, title: '', animation: google.maps.Animation.DROP, optimized: false, zIndex: 9999, icon: '/images/marker2.png' }); //////// СОБЫТИЕ ПРИ КЛИКЕ ГОРОДА //////// google.maps.event.addListener(M1, 'click', function() { infoWindowLenin.close(); infoWindowModern.close(); infoWindowFrunze.close(); infoWindow.open(map,M1); map.panTo(M1.getPosition()); }); google.maps.event.addListener(M2, 'click', function() { infoWindowLenin.close(); infoWindowModern.close(); infoWindow.close(); infoWindowFrunze.open(map,M2); map.panTo(M2.getPosition()); }); google.maps.event.addListener(M3, 'click', function() { infoWindowFrunze.close(); infoWindowModern.close(); infoWindow.close(); infoWindowLenin.open(map,M3); map.panTo(M3.getPosition()); }); google.maps.event.addListener(M4, 'click', function() { infoWindowLenin.close(); infoWindowFrunze.close(); infoWindow.close(); infoWindowModern.open(map,M4); map.panTo(M4.getPosition()); }); $('.map-zoom-controls').on('click', 'a', function (e){ var $this = $(this); var currentZoom = map.getZoom(); if($this.is('.plus')){ map.setZoom(++currentZoom); }else if($this.is('.minus')){ map.setZoom(--currentZoom); } else if($this.is('.sput')){ map.setMapTypeId(google.maps.MapTypeId.SATELLITE); } else if($this.is('.karta')){ map.setMapTypeId(google.maps.MapTypeId.ROADMAP); } }) }