PageSourceSearch

https://www.fabiopizza.ro/core/js/js_body.js?v=1769411389

js fabiopizza.ro collected 2026-09-24 13:29:18 UTC 6,633 bytes, 236 lines download raw bytes

1jQuery.fn.center = function (topmargin=false) {
2    this.css("position","absolute");
3    if (topmargin===false) this.css("top", Math.max(0, (($(window).height() - $(this).outerHeight()) / 2) + $(window).scrollTop()) + "px");
4    else this.css("top", ($(window).scrollTop()+topmargin) + "px");
5    this.css("left", Math.max(0, (($(window).width() - $(this).outerWidth()) / 2) + $(window).scrollLeft()) + "px");
6    return this;
7}
8$(document).ready(function(){
9	const el = document.querySelector(".js-sticky")
10	const observer = new IntersectionObserver( 
11		([e]) => e.target.classList.toggle("js-is-pinned", e.intersectionRatio < 1),
12		{ threshold: [1] }
13	);
14	observer.observe(el);
15
16    $(document).on('click','a[href$="#"]',function(e){e.preventDefault();});
17    $(document).on('click','a[href=#top]',function(e){$('html,body').animate({scrollTop:0},'fast');});	
18    $(document).on('submit','form',function(e){e.preventDefault();});
19    
20    if (load_magnificpopup_) {
21		$('.fncy').magnificPopup({
22			type: 'image',
23			gallery: {
24				enabled: true
25			}
26		});
27		$('.fncy_gallery').each(function () { // the containers for all your galleries
28			$(this).magnificPopup({
29				delegate: 'li a', // the selector for gallery item
30				type: 'image',
31				gallery: {
32					enabled: true
33				}
34			});
35		});
36	}
37    if (load_parazoom_) jQuery('.js-parazoom').parazoom();
38
39/* SPLASH START ____________________________________________ */
40    $(document).on('click','.js-splash-close',function(e){
41	e.preventDefault();
42	parinte = $(this).closest('.js-splash');
43	parinte.hide();
44    });
45    $(document).on('mouseup','.js-splash-close-anywhere',function(e){
46	obj = $(this);
47	var container = $('.js-splash-box',obj);
48	if (!container.is(e.target) && container.has(e.target).length === 0) $('.js-splash-close',obj).trigger('click');
49    });
50/* SPLASH STOP ____________________________________________ */	
51	
52	$(document).on('mouseenter', ".dd", function () {
53		if (!$(this).hasClass("clicked")) {
54			$("ul",this).show();
55		}
56	});
57	$(document).on('mouseleave', ".dd", function () {
58		$("ul",this).hide();
59	});
60	$(document).on('click', ".dd.clicked .trigger", function () {
61		parinte = $(this).parent();
62		$("ul",parinte).show();
63	});
64	$(document).on("click",".dd ul li a",function(e){
65		obj = $(this);
66		parinte = obj.closest('.dd');
67		$(".selval",parinte).val(obj.attr('rel'));
68		$(".trigger span",parinte).text(obj.text());
69		$("ul",parinte).hide();
70	});
71
72	$(".nbr").on("blur",function(){
73		str = $(this).val();
74		str = str.replace(',','.');
75		if (!$.isNumeric(str)) {
76			$(this).val('0');
77		}
78		else $(this).val(str);
79	});
80	$(".nbrint").on("blur",function(){
81		str = $(this).val();
82		if (!isInteger(str)) {
83			$(this).val('0');
84		}
85	});
86	
87	$(document).on("click",".js-mobile-menu-open",function(e){
88	    obj = $(this);
89	    parinte = $('.js-mobile-menu');
90		parinte.addClass('active');
91	    /*trebuie_inchis = (parinte.css('z-index')==110)?true:false;
92	    if (trebuie_inchis) {
93		$('.js-mobile-menu').css('z-index', 100).removeClass('active');
94	    }
95	    else {
96		$('.js-mobile-menu').css('z-index', 100).addClass('active');
97		parinte.css('z-index', 110);
98	    }*/
99	});
100	$(document).on("click",".js-mobile-menu-close",function(e){
101	    obj = $(this);
102	    parinte = $('.js-mobile-menu');
103		parinte.removeClass('active');
104	});
105	
106	$(".js-mobile-menu").swipe({
107	    swipe:function(event, direction, distance, duration, fingerCount, fingerData) {
108		if (direction=='right') {
109		    $('.js-mobile-menu').removeClass('active');
110		}
111	    },
112	    threshold:25
113	});
114	$(".js-mobile-menu-open").swipe({
115	    swipe:function(event, direction, distance, duration, fingerCount, fingerData) {
116		if (direction=='left') {
117		    $(this).trigger('click');
118		}
119	    },
120	    threshold:25
121	});
122	
123	$(document).on('click','.others-mobile-menu-wrapper ul li',function(){
124	    $('.js-mobile-menu').removeClass('active');
125	});
126
127	// Hide Header on on scroll down
128	var didScroll;
129	var lastScrollTop = 0;
130	var delta = 5;
131	var navbarHeight = $('.menubar').outerHeight();
132	
133	$(window).on('scroll', function (event) {
134	    didScroll = true;
135	    if (menu_sticky_) {
136			hgh = $(".topbar").outerHeight();
137			if ($(window).scrollTop() > hgh) {
138				$('.js-stickybar').addClass('fixed');
139				if ($('.js-firsttime-splash').length) $('.js-fts-tip-sticky').addClass('fixed');
140			}
141			else {
142				$('.js-stickybar').removeClass('fixed');
143				if ($('.js-firsttime-splash').length) $('.js-fts-tip-sticky').removeClass('fixed');
144			}
145	    }
146	});
147	
148	setInterval(function() {
149	    if (didScroll) {
150		hasScrolled();
151		didScroll = false;
152	    }
153	}, 250);
154	
155	$(document).on("click",".js-cookies-agree:not(.inactive)",function(e){
156	    e.preventDefault();
157	    obj = $(this);
158	    
159	    obj.addClass('inactive');
160	    if(typeof $ajx != "undefined") $ajx.abort();
161	    $ajx = $.ajax({
162		url: root_ + "ajax.php",
163		type: "POST",
164		dataType: "json",
165		data : {
166		    what: 'set_cookie_agree_to_cookies'
167		},
168		cache: false,
169		success: function(data){
170		    if (data.status) {
171			$('.js-cookies-disclaimer').addClass('invisible');
172		    }
173		    else {
174			alert(data.response);
175			obj.removeClass('inactive');
176		    }
177		},
178		error: function(errdata){
179		    obj.removeClass('inactive');
180		    console.log(errdata);
181		    alert('AJAX ERROR');
182		}
183	    });
184	});
185	
186	$(document).on("click",".js-cookies-agree-revoke:not(.inactive)",function(e){
187	    e.preventDefault();
188	    obj = $(this);
189			
190	    if(typeof $ajx != "undefined") $ajx.abort();
191	    $ajx = $.ajax({
192		url: root_ + "ajax.php",
193		type: "POST",
194		dataType: "json",
195		data : {
196		    what: 'delete_cookie_agree_to_cookies'
197		},
198		cache: false,
199		success: function(data){
200		    location.reload();
201		},
202		error: function(errdata){
203		    obj.removeClass('inactive');
204		    console.log(errdata);
205		    alert('AJAX ERROR');
206		}
207	    });
208	});
209	
210	function hasScrolled() {
211	    var st = $(this).scrollTop();
212	    
213	    // Make sure they scroll more than delta
214	    if(Math.abs(lastScrollTop - st) <= delta)
215		return;
216	    
217	    // If they scrolled down and are past the navbar, add class .nav-up.
218	    // This is necessary so you never see what is "behind" the navbar.
219	    if (st > lastScrollTop && st > navbarHeight){
220		// Scroll Down
221		$('.topbar, .shortcart, .js-mobile-menu').removeClass('nav-down').addClass('nav-up');
222	    } else {
223		// Scroll Up
224		if(st + $(window).height() < $(document).height()) {
225		    $('.topbar, .shortcart, .js-mobile-menu').removeClass('nav-up').addClass('nav-down');
226		}
227	    }
228	    
229	    lastScrollTop = st;
230	}
231
232	$(document).on('click','.telefon-header>a',function(e){
233		/*gtag_report_conversion('tel:0372 188 330');*/
234	});
235
236});	

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.