This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // lazyload фоновых картинок, используя lazysizes.min.js | |
| $(document).on('lazybeforeunveil', function (e) { | |
| var bg = e.target.getAttribute('data-bg'); | |
| if (bg) { | |
| e.target.style.backgroundImage = 'url(' + bg + ')'; | |
| } | |
| }); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| $('html:not(:animated),body:not(:animated)').animate({ | |
| scrollTop: $(element).offset().top | |
| }, 800); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var scrollTop_body = $('html, body').scrollTop() || $(document).scrollTop() || $(window).scrollTop(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function updateURL(params) { | |
| if (history.pushState) { | |
| var baseUrl = window.location.protocol + "//" + window.location.host + window.location.pathname; | |
| var newUrl = baseUrl + '?' + params; | |
| history.pushState(null, null, newUrl); | |
| } | |
| else { | |
| console.warn('History API не поддерживается'); | |
| } | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // Считывает GET переменные из URL страницы и возвращает их как ассоциативный массив. | |
| function getUrlVars(){ | |
| var vars = [], hash; | |
| var hashes = window.location.href.slice(window.location.href.indexOf('?') + 1).split('&'); | |
| for(var i = 0; i < hashes.length; i++) | |
| { | |
| hash = hashes[i].split('='); | |
| vars.push(hash[0]); | |
| vars[hash[0]] = hash[1]; | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| if( this.hasClass('carousel-gallery-js') ){ | |
| var this_carousel = this; | |
| this.find('.owl-carousel').owlCarousel( | |
| { | |
| loop: false, | |
| nav: true, | |
| dots: false, | |
| autoplay: false, | |
| URLhashListener: true, | |
| responsive: cols, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function to_position_select( $select ){ | |
| if( $select.length == 0 ){ | |
| // console.log('Нет ни одного активного select-container'); | |
| return false; | |
| } | |
| var $dropdown_content = $select.find('.dropdown-content'); | |
| $dropdown_content.removeClass('dropdown-content-right'); | |
| $dropdown_content.removeClass('dropdown-content-center'); | |
| $dropdown_content.removeClass('dropdown-content-up'); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // закрытие элемента по клику вне этого элемента | |
| $('body').on('click', '*', function (event) { | |
| if( !$(event.target).closest('.select-container').length && !$(event.target).hasClass('.select-container') ) { | |
| $('.select-container').removeClass('active'); | |
| } | |
| }); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var $slider = $('.side-scroll .side-scroll-wrapper'); | |
| var isDown = false; | |
| var startX; | |
| var scrollLeft; | |
| $slider.mousedown(function(e){ | |
| isDown = true; | |
| $slider.addClass('active'); | |
| startX = e.pageX - $slider.get(0).offsetLeft; | |
| scrollLeft = $slider.get(0).scrollLeft; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var scroll_top_body = 0; | |
| $('.modal').on('shown.bs.modal', function(){ | |
| if ("ontouchstart" in document.documentElement && $(window).width() <= BREAKPOINT_MD){ | |
| // console.log('mobile device'); | |
| scroll_top_body = $(window).scrollTop(); | |
| $('body').css({ | |
| 'position': 'fixed', | |
| 'top': '-' + scroll_top_body + 'px', | |
| 'left': 0 | |
| }); |