PageSourceSearch

https://www.agroecopower.cz/js/submenu.js

js agroecopower.cz collected 2026-10-08 11:14:54 UTC 2,533 bytes, 82 lines download raw bytes

1if (typeof (subMenuDoInit) !== 'undefined' && subMenuDoInit) {
2	$('.submenu').each(function () {
3		parentBlock = $(this).attr('id');
4		
5		i = 1;
6		$('#' + parentBlock + ' .submenu-item').each(function () {
7			$(this).attr('data-parent', parentBlock).attr('data-position', i++);
8		});
9		
10		$(this).attr('data-count', i - 1);
11		
12		$('#' + parentBlock + ' .submenu-control, #' + parentBlock + ' .submenu-control-dots li').each(function () {
13			$(this).attr('data-parent', parentBlock);
14		});
15	});
16	
17	function setTecky(parentBlock, index) {
18		$('#' + parentBlock + ' .submenu-control-dots li.active').removeClass('active');
19		$('#' + parentBlock + ' .submenu-control-dots li[data-show="' + index + '"]').addClass('active');
20	}
21	
22	/*click na šipky*/
23	$('.submenu .submenu-control').on('click', function () {
24		parentBlock = $(this).data('parent');
25		
26		/*posouvám doleva*/
27		if ($(this).hasClass('submenu-control-left')) {
28			index = parseInt($('#' + parentBlock + ' .submenu-item.active').data('position')) - 1;
29			
30			if (index > 0) {
31				$('#' + parentBlock + ' .submenu-item').removeClass('active');
32				$('#' + parentBlock + ' .submenu-item[data-position="' + index + '"]').addClass('active');
33				
34				setTecky(parentBlock, index);
35			}
36		}
37		
38		/*posouvám doprava*/
39		if ($(this).hasClass('submenu-control-right')) {
40			index = parseInt($('#' + parentBlock + ' .submenu-item.active').data('position')) + 1;
41			
42			if (index <= parseInt($('#' + parentBlock).data('count'))) {
43				$('#' + parentBlock + ' .submenu-item').removeClass('active');
44				$('#' + parentBlock + ' .submenu-item[data-position="' + index + '"]').addClass('active');
45				
46				setTecky(parentBlock, index);
47			}
48		}
49		
50		return false;
51	});
52	
53	/*click na body/tecty*/
54	$('.submenu .submenu-control-dots li').on('click', function () {
55		if (!$(this).hasClass('active')) {
56			parentBlock = $(this).data('parent');
57			index = parseInt($(this).data('show'));
58
59			$('#' + parentBlock + ' .submenu-item').removeClass('active');
60			$('#' + parentBlock + ' .submenu-item[data-position="' + index + '"]').addClass('active');
61
62			$('.submenu .submenu-control-dots li').removeClass('active');
63			$(this).addClass('active');
64		}
65	});
66	
67	/*hover*/
68	$('.submenu .submenu-item').hover(
69		function () {
70			if (!$(this).hasClass('active')) {
71				parentBlock = $(this).data('parent');
72				$('#' + parentBlock + ' .submenu-item').removeClass('active');
73				$(this).addClass('active');
74				
75				setTecky(parentBlock, $(this).data('position'));
76			}
77		},
78		function () {
79
80		}
81	);
82}

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.