PageSourceSearch

https://osteomed-clinic.ru/assets/js/mobile.js

js osteomed-clinic.ru collected 2026-10-02 07:04:50 UTC 5,139 bytes, 121 lines download raw bytes

1$(document).ready(function() {
2    if(window.screen.width<=765){
3
4    	if (/iPhone|iPad|iPod/i.test(navigator.userAgent)) {
5	        $(window).scroll(function () {
6	            var wrap = $('.header__main').height() +  $('.menu-mobile_menu').height() + $('.menu-mobile_phone').height() + 160;
7	            $('.nav-main_scroll').height(screen.height - wrap);
8	        });
9		}
10
11
12        $(document).on('click', '.search__btn:not(.active)', function(e){
13            e.stopPropagation();
14            e.preventDefault();
15            var s = $(this).closest('.header__search');
16            $(this).addClass('active');
17            s.addClass('active');
18        });
19
20        $('.close-header__search').on('click',function(){
21            $('.header__search,.search__btn').removeClass('active');
22        });
23
24        if($('.reviews-item__review')){
25            $('.reviews-item__review').each(function(){                
26                if($(this).find('p').length > 1) {
27
28                    $(this).find('p').not(':eq(0)').wrapAll("<div class='reviews-item__wrap'></div>");
29                    $(this).find('.reviews-item__wrap').after('<div class="show-content-wrap"><span class="show-content">Читать весь отзыв</span></div>');
30                }
31            });
32        }
33
34        $(document).on('click', '.show-content', function(){
35            var that = $(this).closest('.reviews-item__review').find('.reviews-item__wrap');
36            var button = $(this).closest('.reviews-item__review').find('.show-content');
37            if (that.is(":hidden")) {
38                that.slideDown("slow");
39                button.text('Скрыть отзыв');
40            } else {
41                that.slideUp("slow");
42                button.text('Читать весь отзыв');
43            }
44        });
45
46        if($().slick) {
47            $('.js-slider-counted').on('init', function (event, slick) {
48                $(this).closest('.js-slider-counted-wrap').find('.slider-controls__counter').html('<span>1</span> / <span>' + slick.slideCount + '</span>');
49            });
50            $(".js-slider-counted").slick({
51                infinite: true,
52                slidesToShow: 1,
53                autoplay: false,
54                dots: false,
55                arrows: true,
56                appendArrows: $(".js-slider-counted-wrap .slider-controls"),
57                prevArrow: '<i class="slick-arrow slick-prev fa fa-angle-left trans" />',
58                nextArrow: '<i class="slick-arrow slick-next fa fa-angle-right trans" />'
59            });
60            $('.js-slider-counted').on('afterChange', function (event, slick, currentSlide) {
61                $(this).closest('.js-slider-counted-wrap').find('.slider-controls__counter').html('<span>' + (currentSlide + 1) + '</span> / <span>' + slick.slideCount + '</span>');
62            });
63
64            $('.video-slider').on('afterChange', function (event, slick, currentSlide) {
65                $(this).closest('.video-box').find('.slider-controls__counter').html('<span>' + (currentSlide + 1) + '</span> / <span>' + slick.slideCount + '</span>');
66            });
67
68            $('.slider-doctors').on('afterChange', function (event, slick, currentSlide) {
69                $(this).closest('.section-doctors').find('.slider-controls__counter').html('<span>' + (currentSlide + 1) + '</span> / <span>' + slick.slideCount + '</span>');
70            });
71        }
72    }
73    
74    // Мобильное меню - работает независимо от размера экрана
75    var $mobileMenuToggle = $('#mobileMenuToggle');
76    var $mobileMenuOverlay = $('#mobileMenuOverlay');
77    var $mobileMenuClose = $('#mobileMenuClose');
78    var $body = $('body');
79
80    function closeMobileMenu() {
81        $mobileMenuOverlay.removeClass('active');
82        $mobileMenuToggle.removeClass('active');
83        $body.removeClass('mobile-menu-open');
84    }
85
86    if ($mobileMenuToggle.length && $mobileMenuOverlay.length) {
87        // Переключение меню (открытие/закрытие)
88        $mobileMenuToggle.on('click', function(e) {
89            e.preventDefault();
90            e.stopPropagation();
91            
92            if ($mobileMenuOverlay.hasClass('active')) {
93                // Меню открыто - закрываем
94                closeMobileMenu();
95            } else {
96                // Меню закрыто - открываем
97                $mobileMenuOverlay.addClass('active');
98                $mobileMenuToggle.addClass('active');
99                $body.addClass('mobile-menu-open');
100            }
101        });
102
103        // Закрытие меню через кнопку
104        if ($mobileMenuClose.length) {
105            $mobileMenuClose.on('click', function(e) {
106                e.preventDefault();
107                e.stopPropagation();
108                closeMobileMenu();
109            });
110        }
111
112        // Закрытие по клику вне меню (на overlay)
113        $mobileMenuOverlay.on('click', function(e) {
114            if (e.target === this) {
115                closeMobileMenu();
116            }
117        });
118    }
119    
120
121});

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.