$(document).ready(function () { YaMapsShown = false; const swiper = new Swiper('.swiper-container', { cssWidthAndHeight: true, slidesPerView:'auto', centeredSlides: true, navigation: { nextEl: '.swiper-button-next', prevEl: '.swiper-button-prev', }, // breakpoints: { // 450: { // slidesPerView: 1, // spaceBetween: 30 // }, // 995: { // slidesPerView: 2, // spaceBetween: 30 // } // } }); var swiper2 = document.querySelector(".slider_staff").swiper; swiper2.slideNext(); var mySwiper = document.querySelector('.slider_reviews').swiper; mySwiper.slideNext(); $(window).scroll(function() { if (!YaMapsShown){ if($(window).scrollTop() + $(window).height() > $(document).height() - 700) { showYaMaps(); YaMapsShown = true; } } }); var lazyLoadInstance = new LazyLoad({}); }); $(function () { $(".btn_register").click(function () { $(".btn_register_modal").modal('show'); }); }); $(window).scroll(function() { var url = new URL(window.location.href); var searchParams = new URLSearchParams(url.search.substring(1)); var center = searchParams.get("center"); if ($(document).scrollTop() > 100 && $("#scroll111").attr("displayed") === "false" && center === null) { $('#scroll').modal('show'); $("#scroll").attr("displayed", "true"); } } ); function showYaMaps(){ var script = document.createElement("script"); script.type = "text/javascript"; script.src = "https://yandex.ru/maps/10716/balashiha/?utm_medium=mapframe&utm_source=maps"; document.getElementById("YaMaps").appendChild(script); }