PageSourceSearch

https://www.nationaledrugmonitor.nl/wp-content/themes/trimbos-ndm-…/js/custom-page.js?ver=20260924-03-26-21

js nationaledrugmonitor.nl collected 2026-09-24 20:26:12 UTC 6,044 bytes, 261 lines download raw bytes

1(function($) {
2	$(document).ready(function(){
3
4
5		
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23  var stickyTop = $('.sticker').offset().top;
24
25  if (window.innerWidth > 991) {	
26	  $(window).scroll(function() {
27	    var windowTop = $(window).scrollTop();
28	    if (stickyTop < windowTop && $("#content").height() + $("#content").offset().top - $(".sticker").height() > windowTop) {
29	      $('.sticker').css('position', 'fixed');
30	    } else {
31	      $('.sticker').css('position', 'absolute');
32	    }
33	  });
34  }else{
35  	$('.sticker').css('position', 'fixed');
36	document.addEventListener("scroll", Scroll, false);
37	function Scroll() {
38	    //console.log(window.pageYOffset);
39	    if (window.pageYOffset > 0) {
40	    	$('.accessability_container').css('position', 'absolute');
41	    }
42	}
43  }
44
45
46
47
48
49function getDuration(target) {
50    var currentTop = $(window).scrollTop(),
51            rate = 0.5, // 1000px/500ms
52            distance;
53    distance = Math.abs(currentTop - target);
54    return distance * rate;
55}
56
57
58
59
60
61$(function() {
62    $("#scrolltop").on('click', function() {
63    	$("#sticker-form").removeClass('act');
64    var bottom = $(document).height() - $(window).height();
65    var topPage = 0;
66       var duration = getDuration(topPage);
67       $("HTML, BODY").animate({
68           scrollTop: topPage
69        }, duration);
70    });
71});
72
73
74
75
76
77
78$(function() {
79    $("#sticker-openform").on('click', function() { 
80       $("#sticker-form").toggleClass('act');
81    });
82});
83
84
85$(function() {
86    $("#sticker-closeform").on('click', function() { 
87       $("#sticker-form").removeClass('act');
88    });
89});
90
91
92
93
94
95
96
97
98
99
100
101		function topHeaderSetup() {
102			
103		if (window.innerWidth < 992) {			
104			
105			$(".above-header-user-select").append('<div class="ast-custom-html above-header-top-right-icons"><img src="https://www.drugsinfo.nl/wp-content/uploads/sites/7/2019/12/logo-trimbos-wit-180x90.png" class="logo" style="width:72px">	<div class="abv-header-site-title"><a href="https://www.nationaledrugmonitor.nl/"><span>Nationale</span> <span>Drug</span> <span>Monitor</span></a></div> <img src="https://www.nationaledrugmonitor.nl//wp-content/uploads/2020/01/[email protected]" class="access" style="width:17px;margin-right:44px"></div>');
106
107			//$(".above-header-user-select").append('<div class="ast-custom-html above-header-top-right-icons"><img src="https://www.drugsinfo.nl/wp-content/uploads/sites/7/2019/12/logo-trimbos-wit-180x90.png" class="logo" style="width:72px">	<div class="abv-header-site-title"><a href="https://www.nationaledrugmonitor.nl/"><img class="ndm-logo-25years" src="https://www.nationaledrugmonitor.nl/wp-content/uploads/2024/05/ndm-logo-25years.png">	</a></div> <img src="https://www.nationaledrugmonitor.nl//wp-content/uploads/2020/01/[email protected]" class="access" style="width:17px;margin-right:44px"></div>');
108			
109			
110		}else{
111				$(".ast-above-header-section-2").prepend('<div class="abv-header-site-title"><a href="https://www.nationaledrugmonitor.nl/"><span>Nationale</span> <span>Drug</span> <span>Monitor</span></a></div>');
112
113			//$(".ast-above-header-section-2").prepend('<div class="abv-header-site-title"><a href="https://www.nationaledrugmonitor.nl/"><img class="ndm-logo-25years" src="https://www.nationaledrugmonitor.nl/wp-content/uploads/2024/05/ndm-logo-25years.png">	</a></div>');
114
115
116			$(".above-header-user-select").append('<div class="ast-custom-html above-header-top-right-icons">	<img src="https://www.nationaledrugmonitor.nl/wp-content/uploads/2020/01/[email protected]" class="access" style="width:22px;margin-right:30px">	<img src="https://www.nationaledrugmonitor.nl/wp-content/uploads/sites/7/2019/12/logo-trimbos-wit-180x90.png" class="logo" style="width:125px"></div>');
117		}
118			
119		} 
120		//END top header setup
121		//
122		//
123		//
124		function topHeaderPos() {
125setTimeout(function(){
126	
127						// var accessImgPosTop = $('.above-header-top-right-icons').find('.access').offset().top;
128						var accessImgPosTop = 26;
129						var accessImgPosLeft = $('.above-header-top-right-icons').find('.access').offset().left;  
130						//console.log(accessImgPosLeft);//20
131						accessImgPosLeft = accessImgPosLeft  - $(window).width();
132						//console.log(accessImgPosLeft);//-300
133						var newAccessImg = $('.accessability_container .aicon_link');
134											
135						//$(newAccessImg).css({left: accessImgPosLeft});
136						if (window.innerWidth < 992) {
137							//slidesPerViewaccessImgPosTop = accessImgPosTop -4;
138							accessImgPosTop = 18;
139							accessImgPosLeft =  -100;
140							if (window.innerWidth < 346) {
141								accessImgPosLeft =  -87;
142								if (window.innerWidth < 339) {
143									accessImgPosLeft =  -75;
144								}
145							}
146							
147							
148						}
149						// -312
150						//console.log('2- '+accessImgPosTop + '/' +accessImgPosLeft);
151
152						$(newAccessImg).attr('style', 'top: '+accessImgPosTop+'px !important;right: auto !important; left:'+accessImgPosLeft+'px !important;');
153
154}, 500);
155		}
156
157
158
159
160
161
162
163
164
165
166
167		
168
169
170		
171		topHeaderSetup();
172		topHeaderPos();
173		$(window).on("resize orientationchange", function(){
174			
175			$('.above-header-top-right-icons').remove();
176			$('.abv-header-site-title').remove();
177			
178			topHeaderSetup();
179			topHeaderPos();
180		});
181		
182		
183		
184		
185		
186	
187
188
189
190
191
192
193		//////////
194
195
196
197
198
199
200
201
202
203   
204
205
206
207
208
209
210
211
212
213
214
215
216
217/// hide submenu "in deze paragraaf" for top level without children
218$('div.sidebar-main ul#menu-ontwikkelingen-in-gebruik-1 > li.menu-item').each(function(){
219		var item = $(this);
220		if (item.hasClass('menu-item-has-children')) {
221			if ( item.hasClass('current-menu-parent') || item.hasClass('current-menu-item') ) {
222				setTimeout(function(){ 
223					$('.submenu-siblings').slideDown();	
224				}, 250);
225			}
226				
227		}
228});
229
230
231
232
233setTimeout(function(){ 			
234			
235		if (window.innerWidth < 992) {
236
237			$(".everviz-data-table-container").niceScroll(".everviz-data-table",{
238			      cursorwidth:6,
239			      cursoropacitymin:0.4,
240			      cursorcolor:'#d4d4d4',
241			      cursorborder:'none',
242			      cursorborderradius:4,
243			      autohidemode:'leave'
244			}); 
245
246			console.log('NiceScroll 5s') 
247
248		}
249
250
251
252		 }, 2000);
253
254
255
256
257
258
259
260	});
261})(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.