PageSourceSearch

https://netwellness.org/wp-content/themes/minimal-white-child/functions-ver=6.6.2.js

js netwellness.org collected 2026-10-02 06:42:20 UTC 5,473 bytes, 234 lines download raw bytes

1;(function($, window, document, undefined) {
2	var $win = $(window);
3	var $doc = $(document);
4	var scroller, $page, $header, $adminBar;
5
6	$doc.ready(function() {
7		$page = $('html, body');
8		$header = $('.wrapper__inner .header');
9		$adminBar = $('#wpadminbar');
10		var $headerFixed = $('.header-fixed');
11		var $scrollFix = $('.scroll-fix');
12
13		if ( $( ".article-anchor-title" ).length ) {
14			$(".link-anchors").append( '<strong>Jump to:</strong>' );
15
16			$( ".article-anchor-title" ).each(function( index ) {
17			  var anchor 	= $( this ).attr('id');
18			  var title 	= $( this ).data('title');
19			  $(".link-anchors").append( '<a href="#' + anchor + '">' + title + '</a> | ');
20			});
21
22		};
23		var anchor_offset = 110;
24		if ( $('body').hasClass('logged-in') ) {
25			anchor_offset = 142;
26		}
27		console.log( anchor_offset );
28		$(".link-anchors").on('click', 'a', function(event) {
29			event.preventDefault();
30			var href = $(this).attr( 'href' );
31			 $('html, body').animate({
32		        scrollTop: $( href ).offset().top - anchor_offset
33		    }, 500);
34		});
35
36		$win.on('scroll', function() {
37			$headerFixed.toggleClass('active', $win.scrollTop() > $win.height() * 5 / 10);
38		});
39
40		// $('.slider-items .slides').owlCarousel({
41		// 	loop: true,
42		// 	nav: true,
43		// 	responsive: {
44		// 		0: {
45		// 			items: 1,
46		// 			margin: 20,
47		// 			stagePadding: 60
48		// 		},
49		// 		768: {
50		// 			items: 2,
51		// 			margin: 20,
52		// 			stagePadding: 188
53		// 		},
54		// 		992: {
55		// 			items: 3,
56		// 			margin: 30,
57		// 			stagePadding: 0
58		// 		}
59		// 	}
60		// });
61
62		// $('.select').dropdown();
63
64		// $('.nav .menu-item-has-children > a').on('click', function(event) {
65		// 	if ( $win.width() < 1200 ) {
66		// 		event.preventDefault();
67		//
68		// 		$(this).toggleClass('active').next().stop().slideToggle();
69		// 	}
70		// });
71
72		// $('.nav-trigger').on('click', function(event) {
73		// 	event.preventDefault();
74		//
75		// 	$(this).toggleClass('active');
76		//
77		// 	$('.nav').toggleClass('active');
78		//
79		// 	$('.header-phone-mobile').removeClass('active');
80		// });
81		//
82		// $('.link-phone').on('click', function(event) {
83		// 	event.preventDefault();
84		//
85		// 	$('.nav').removeClass('active');
86		//
87		// 	$('.nav-trigger').removeClass('active');
88		//
89		// 	$('.header-phone-mobile').toggleClass('active');
90		// });
91		//
92		// $('.widget_nav_menu .menu li.menu-item-has-children > a').on('click', function(e) {
93		// 	e.preventDefault();
94		//
95		// 	$this = $(this);
96		// 	$sub_menu = $this.next();
97		//
98		// 	if ( $sub_menu.is(':visible') ){
99		// 		$sub_menu.slideUp(200);
100		// 	} else {
101		// 		$this.parent().siblings().find('.sub-menu').slideUp(200, function(){
102		//
103		// 			$sub_menu.slideDown(200);
104		// 		});
105		// 	}
106		// });
107
108		$('.scroll-to').on('click', function(event) {
109			event.preventDefault();
110
111			var $target = $($(this).attr('href'));
112			var headerOffset = 0;
113
114			if ( $win.width() < 1200 ) {
115				headerOffset = $header.innerHeight();
116			} else {
117				headerOffset = $headerFixed.innerHeight();
118
119				if ( $('.link-anchors').length ) {
120					headerOffset = headerOffset + $('.link-anchors').innerHeight();
121				}
122			}
123
124			$('html, body').animate({
125				scrollTop: $target.offset().top - headerOffset
126			});
127		});
128
129		$scrollFix.each(function() {
130			var $el = $(this);
131			var $holder = $el.closest('.scroll-fix-holder');
132
133			$win.on('scroll', function() {
134				if ( $win.width() > 1024 ) {
135					$el.toggleClass('fixed', $holder.offset().top - $headerFixed.innerHeight() < $win.scrollTop());
136				}
137			});
138		});
139
140
141		$win.on('resize', function() {
142			if (scroller) {
143				setTimeout(function() {
144					scroller.refresh();
145				}, 500)
146			}
147		});
148
149		article_progressbar();
150	});
151
152	$win.on('load', function() {
153		if ( $win.width() >= 1200 ) {
154			scroller = skrollr.init({
155				smoothScrolling: false,
156				mobileCheck: function() {
157					return false;
158				},
159				forceHeight: false
160			});
161		}
162	});
163
164	function article_progressbar() {
165		var $article = $('.page__entry');
166		var $widget = $('.widget_text');
167		var $sidebar = $('.sidebar')
168
169		if ( !$widget.length ) return false;
170    
171    if (typeof $('.jumpers').val() === 'undefined') {
172			$widget.hide();
173			$sidebar.hide();
174		}
175
176		var $object = $('<ul />');
177
178		$('.jumpers a').each(function() {
179			$object.append( $('<li />').append(this).data('name', $(this).attr('href').replace('#', '')) );
180		});
181
182		$('.jumpers').remove();
183
184		if ( $object.find('li').length ) {
185			$object.wrapAll('<div class="wrap" />');
186
187			$widget.append( $object.parent() );
188
189			$widget.find('.wrap').append('<div class="progress"><span /></div>');
190		} else {
191			return false;
192		}
193
194		$widget.on('click', '.wrap a', function(event) {
195			var $name = $(this).parent().data('name');
196			console.log($name);
197			if ( $name !== undefined ) {
198				scrollTo( $('[name="' + $name + '"]').offset().top );
199			}
200
201			event.preventDefault();
202		});
203
204		$('.widget_text').hcSticky({
205			stickTo: '.main',
206			followScroll: true,
207			top: 120,
208			offResolutions: -768
209		});
210
211		var $progress = $widget.find('.progress');
212
213		$win.on('load scroll', function() {
214			var percent = ( ( $win.scrollTop() - $article.offset().top ) / $article.height() ) * 100;
215
216			percent = percent > 0 ? percent : 0;
217
218			$progress.find('span').height( percent + '%' );
219		});
220	}
221
222	function scrollTo(top) {
223		$page.animate({
224			scrollTop: getScrollTop( top )
225		});
226	}
227
228  
229	function getScrollTop(top) {
230		console.log(top);
231		return top - $header.outerHeight() - $adminBar.outerHeight() - 90;
232	}
233
234})(jQuery, window, document);

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.