PageSourceSearch

https://www.sumavanet.cz/include/rsmenu1926.js

js sumavanet.cz collected 2026-10-02 10:27:50 UTC 5,020 bytes, 156 lines download raw bytes

1( function( $ ) {
2$( document ).ready(function() {
3$('#rsmenu').prepend('<div id="menu-button">Menu</div>');
4	$('#rsmenu #menu-button').on('click', function(){
5		var menu = $(this).next('ul');
6		if (menu.hasClass('open')) {
7			menu.removeClass('open');
8		}
9		else {
10			menu.addClass('open');
11		}
12	});
13	velikost();	
14	// resizeimages();
15
16	// odstranìní width + height z obrázkù
17  $('#portmain img').removeAttr('width height');
18	
19 	// bxslider se spousti jen tehdy, pokud je v kodu div r_slider
20 	if ( $( "#r_slider" ).length ) {	
21 		var r_sl = $('#r_slider').detach();
22  	r_sl.insertAfter("h1");	
23  	$('.bxslider').bxSlider({
24  		auto: true,
25  		autoControls: false,
26  		pager: false,
27  		controls: true,
28  		captions: false,
29		});
30	}
31});
32
33// velikost ... pøi zmìnì velikosti pøepíná menu na responzivní (posunuje div)
34
35function velikost() {
36  var mql = window.matchMedia("screen and (max-width: 983px)")
37	if (mql.matches){ // if media query matches
38	
39 	document.getElementById("mobnav").style.display = "block";
40  document.getElementById("rsmenu_kotva").style.display = "none";
41 
42	// posun horního reklamního banneru
43	// var toprekl = $('#uvod_reklbox_top').detach();
44  // toprekl.appendTo('.titulni1');
45
46	// posuny blokù - napø. textová reklama na US + novinky, partneøi atd.
47	
48	
49	
50
51 	}	
52	else{
53
54
55	document.getElementById("mobnav").style.display = "none";
56  document.getElementById("rsmenu_kotva").style.display = "block";
57
58	// var toprekl = $('#uvod_reklbox_top').detach();
59  // toprekl.prependTo( "#port-right" );
60
61	// posuny blokù - napø. textová reklama na US + novinky, partneøi atd.
62	
63	
64	 			
65	}
66
67
68  var smql = window.matchMedia("screen and (max-width: 800px)")
69	
70
71
72
73};
74
75// resizeimages ... upravuje velikosti obrazku v obsahustranky
76// momentalne nepouzivam, je z prvni generace responzivity
77// nyní nastaveno ve stylech + javascriptem odstrenene width a height
78
79function resizeimages() {
80 if ( ( $( "#obsahstranky" ).length ) && ( $( "#noresizeimages" ).length <= 0 ) ) {		// otestujeme, ¾e je na strance div #obsahstranky
81  var mql = window.matchMedia("screen and (max-width: 1760px)")
82	if (mql.matches){ // if media query matches
83		var max = 100;
84		$('#obsahstranky img').each(function() {
85		 var width = $(this).width();
86     var height = $(this).height();
87     var pomw =  $(this).width();						// pomocna sirka - dam si tam pak originalni sirku
88     if (( width > 0 ) && ( height > 0)) {
89    	// naplníme atributy orig_w, orig_h
90    	if (($(this).attr('orig_w') == undefined) || ($(this).attr('orig_h') == undefined)) {
91				 $(this).attr('orig_w', $(this).width() );
92				 $(this).attr('orig_h', $(this).height() );
93				 if (( $( "#obsahstranky" ).attr('mobil') == undefined ) || ( $( "#obsahstranky" ).attr('mobil') == 0 )) {		// nastavime priznak, ¾e se neco zmensovalo
94				    $( "#obsahstranky" ).attr('mobil',1);
95				 }
96			} else {
97					width  = $(this).attr('orig_w');
98      		height = $(this).attr('orig_h');
99      		pomw =  width;
100			};   	
101
102    	max = $(this).parent().width();
103
104    	var obsahsirka = Math.round( $('#obsahstranky').width()-10 );
105			if (( obsahsirka < max ) && ( obsahsirka > 0)) {
106				max = obsahsirka;
107			};
108    	// alert(max);
109    	if ( max <= 0 ) { 
110    		max = 150
111    	};
112    	
113    	if ( (( width > max) && ( max > 0)) || ( pomw > width ) ) {
114    			// var img_real_width, img_real_height, new_height;
115    			// img_real_width = $(this).width();
116          // img_real_height = $(this).height();
117      	  // new_height = Math.round(img_real_height / ( img_real_width / max ));
118      	  new_height = Math.round(height / ( width / max ));
119      	  $(this).width(max);
120      	  $(this).height(new_height);
121    	};
122    	// $(this).removeAttr('height');
123     } // width > 0
124		});		
125 	}	
126	else{
127	 	if (( $( "#obsahstranky" ).attr('mobil') !== undefined ) && ( $( "#obsahstranky" ).attr('mobil') !== 1 )) {		// je nastaven priznak, ¾e se neco zmensovalo
128	 		// $( "#obsahstranky" ).removeAttr( "mobil" );
129	 		$( "#obsahstranky" ).attr('mobil',0);
130	 		$('#obsahstranky img').each(function() {
131				 if (($(this).attr('orig_w') !== undefined ) && ($(this).attr('orig_h') !== undefined )) {	
132					$(this).width($(this).attr('orig_w'));
133      	  $(this).height($(this).attr('orig_h'));
134					//	$(this).css('width', 'initial'); // tohle taky funguje, ale dava to nativni velikost, ne velikost uvedenou v html kodu
135					//	$(this).css('height', 'initial');	
136				 		
137    			// $(this).width($(this).get(0).naturalWidth); // tohle funguje, ale dava to nativni velikost, ne velikost uvedenou v html kodu
138    			// $(this).height($(this).get(0).naturalHeight);
139    		 }	
140				
141    	}); // konec each	
142    	
143		} 
144
145	} // if (mql.matches)
146 } // if ( $( "#obsahstranky" ).length )
147};
148
149// --------------- obsluha pøi zmìnách velikosti okna --------------------
150
151$( window ).resize(function() {
152	velikost();
153//	resizeimages();
154});
155
156} )( jQuery );

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.