PageSourceSearch

https://quesoschillon.es/wp-content/themes/meabhy/inc/integration/header/js/sticky-navigation.js?ver=2.2.4

js quesoschillon.es collected 2026-10-10 00:48:30 UTC 3,130 bytes, 120 lines download raw bytes

1/* global jQuery:false */
2/*jshint esversion: 6 */
3(function($) {
4	
5	"use strict";
6
7	// Sticky Vars
8	var sticky = jQuery('.wpisset-navigation').data('sticky');
9	var delay = jQuery(".wpisset-navigation").data('sticky-delay');
10	var animation = jQuery(".wpisset-navigation").data('sticky-animation');
11	var duration = jQuery(".wpisset-navigation").data('sticky-animation-duration');
12
13	var offset_top = jQuery('.wpisset-navigation').offset().top;
14	
15	var fired = 0;
16	var lastScrollTop = 0;
17	
18	var distance = parseInt(offset_top) + parseInt(delay);
19
20	// Sticky Navigation
21	function stickyNavigation() {
22
23	var scroll_top = jQuery(window).scrollTop();
24
25	var navHeight = jQuery('.wpisset-navigation').outerHeight();
26
27		if (scroll_top > distance && fired == '0') {
28
29			jQuery('.wpisset-navigation').addClass('wpisset-navigation-active');
30
31			if(animation == 'slide') {
32
33				jQuery('.wpisset-navigation').css({ 'position':'fixed', 'left':'0', 'right':'0', 'zIndex':'999', 'top': -navHeight }).animate({'top':0}, duration);
34
35			} else if(animation == 'fade') {
36
37				jQuery('.wpisset-navigation').css({ 'display':'none', 'position':'fixed', 'top':'0', 'left':'0', 'right':'0', 'zIndex':'999' }).fadeIn(duration);
38
39			} else {
40
41				jQuery('.wpisset-navigation').css({ 'position': 'fixed', 'top':'0', 'left':'0', 'right':'0', 'zIndex':'999' });
42
43				if(animation == 'scroll') {
44
45					jQuery('.wpisset-navigation').addClass('wpisset-navigation-animate');
46
47				}
48
49			}
50
51			if (!jQuery('body').hasClass('wpisset-transparent-header')) {
52
53				jQuery('.wpisset-page-header').css('marginTop', navHeight);
54
55			}
56
57			fired = '1';
58
59		} else if (scroll_top < distance && fired == '1') {
60
61			jQuery('.wpisset-navigation').removeClass('wpisset-navigation-active wpisset-navigation-animate');
62
63			if (!jQuery('body').hasClass('wpisset-transparent-header')) {
64
65				jQuery('.wpisset-navigation').css({ 'position':'', 'top':'', 'left':'', 'right':'', 'zIndex':'' });
66				jQuery('.wpisset-page-header').css('marginTop', '');
67
68			} else {
69
70				jQuery('.wpisset-navigation').css({ 'position':'', 'top':'', 'left':'', 'right':'', 'zIndex':'' });
71
72			}
73
74			fired = '0';
75
76		}
77
78	};
79
80	// Hide on Scroll
81	function HideOnScroll() {
82		var scroll_top = jQuery(window).scrollTop();
83		var navHeight = jQuery('.wpisset-navigation').outerHeight();
84
85	    if(Math.abs(lastScrollTop - scroll_top) <= delay) return;
86
87		if (scroll_top > lastScrollTop && scroll_top > navHeight){
88			// Scroll Down
89			jQuery('.wpisset-navigation').css({'top':-navHeight});
90			jQuery('.wpisset-navigation').removeClass('wpisset-navigation-scroll-up').addClass('wpisset-navigation-scroll-down');
91		} else {
92			// Scroll Up
93			if(scroll_top + jQuery(window).height() < jQuery(document).height()) {
94				jQuery('.wpisset-navigation').css({'top':'0px'});
95				jQuery('.wpisset-navigation').removeClass('wpisset-navigation-scroll-down').addClass('wpisset-navigation-scroll-up');
96			}
97		}
98
99		lastScrollTop = scroll_top;
100		
101	}
102
103	// execute		
104	if(sticky) {
105
106		jQuery(window).scroll(function() {
107
108			stickyNavigation();
109
110			if(sticky && animation == 'scroll') {
111
112				HideOnScroll();
113
114			}
115
116		});
117
118	}
119
120})( 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.