PageSourceSearch

https://royal-comfort.ru/t/v424/images/js/site.addons.lp.js

js royal-comfort.ru collected 2026-10-07 21:29:40 UTC 3,718 bytes, 146 lines download raw bytes

1/**
2 * reg_id: 5326690
3 * staff_id:618 
4 * меню верхнее
5**/
6
7$(function(){
8	$.ajax({
9		url: "/menu_ex",
10		method: "get",
11		dataType: "html",
12		success: function (data, statusText) {
13			$('.top-block-lp').html(data);
14			console.log($(data));
15			menu_h();
16		},
17		error: function (){
18			console.log('Не удалось загрузить меню');
19		}
20	});	
21	
22	
23	
24	
25	
26	
27})
28
29
30function menu_h(){
31	$('.menu-24 ul ul').parent().each(function() {
32		var o = $(this);
33		var s = o.find('>ul');
34		var l = o.parents('ul').length;
35		var k = false;
36		o.hover(
37			function() {
38				o.find('>a').attr('class','hover');
39				for (i=$('.menu-24 ul ul').length; i>=0; i--){
40					o.parent().find('>li').not(o).find('ul').eq(i).hide();
41				}
42				k = true;
43				var p = o.position();
44				var ts, ls;
45				if (l == 1) {
46					ts =  p.top + o.height();
47					ls = p.left;
48				} else {
49					ts = p.top;
50					ls = p.left + o.width();
51				}
52				s.css({
53					top: ts,
54					left: ls
55				}).show();
56			},
57			function() {
58				o.find('>a').attr('class','normal');
59				k = false;
60				window.setTimeout(function() {
61					if (!k) s.hide(); 						   
62				}, 500);
63			}
64		);
65	});
66	
67	if($('.block-29').length) {
68		var $menu = $('.block-29'),
69			menuHeight = $menu.height(),
70			$menuEmpty = $('.menu-empty'),
71			menuPos = $menu.offset().top;
72	
73		$menuEmpty.height(menuHeight);
74			
75		$(window).scroll(function(){
76			if ( $(this).scrollTop() > menuPos ) {
77				$menu.addClass('fixx');
78				$('.menu-empty').show();
79			} else {
80				$menu.removeClass('fixx');
81				$('.menu-empty').hide();
82			}
83		});
84	}
85	
86	function resizeController(){var i=$(window),o=i.width(),n=[],e=[],t=[void 0,void 0];if(arguments.length)for(var d=0;d<=arguments.length-1;d++)$.isArray(arguments[d])?n=arguments[d]:$.isNumeric(arguments[d])?n.push(arguments[d]):$.isFunction(arguments[d])&&e.push(arguments[d]);i.resize(function(d){o=i.width(),n.length>1?o>=n[0]&&o<=n[n.length-1]&&void 0===t[0]?(e[0](),t[0]=!0,t[1]=void 0):(o<n[0]||o>n[n.length-1])&&void 0===t[1]&&(t[0]=void 0,t[1]=!0,$.isFunction(e[1])&&e[1]()):1==n.length&&(o<=n[0]&&void 0===t[0]?(e[0](),t[0]=!0,t[1]=void 0):o>n[0]&&void 0===t[1]&&(t[0]=void 0,t[1]=!0,$.isFunction(e[1])&&e[1]()))}).trigger("resize")}
87	
88	resizeController([-Infinity, 960], function(){
89		$('.side-panel-content-inner').append($('.menu-24'));
90		$('.block-29').hide();
91		
92	});
93	resizeController([961, Infinity], function(){
94		$('.block-29').append($('.menu-24'));
95		$('.block-29').show();
96	});
97	
98	$(document).on('click', '.side-panel-button', function(){
99		$('.side-panel-mask').addClass('active');
100		$('.side-panel-content').addClass('active');
101		$('body').addClass('noscroll');
102	})
103	
104	$(document).on('click', function(e) {
105		console.log($(e.target).hasClass('side-panel-mask'))
106		if ( $(e.target).hasClass('side-panel-mask') ) {
107			$('.side-panel-mask, .side-panel-content').removeClass('active');
108			$('body').removeClass('noscroll')
109		} else {
110			
111		}
112	});
113	
114	$('.side-panel-content-inner .menu-24 a').on('click touchstart',function(){
115		var $this = $(this);
116		var par = $this.parent();
117		if (par.find('>ul').length && !$this.hasClass('hover')){
118			$this.parent().parent().find('>li').removeClass('submenu-opened').find('>a').removeClass('hover');
119			$this.parent().parent().find('>li > ul').hide();
120			par.addClass('submenu-opened');
121			$this.addClass('hover');
122			par.find('>ul').show();
123			console.log(this)
124			return false; 
125		} else {
126			return true; 
127		}
128		
129		
130	})
131	
132
133
134
135
136
137
138
139// конец функции
140}
141
142
143$(window).load(function() {
144    $(".loader").delay(100).fadeOut().remove();    
145
146});

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.