PageSourceSearch

https://neutronscattering.org/wp-content/themes/mayecreate-theme/js/mayecreate_scripts.js?ver=3.0.0

js neutronscattering.org collected 2026-10-02 17:06:27 UTC 13,087 bytes, 275 lines download raw bytes

1jQuery(document).ready(function($) {  // Opening jQuery this way allows for the use of the '$' vs having to change it to the word 'jQuery'
2  
3  
4  // This is the javascript to stops the default click beahvior and replaces it with a tap funtionality on ipad and other small touch devices 
5  if( /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent) ) {
6    $(".menu li a").each(function() {
7          if ($(this).next().length > 0) {
8            $(this).addClass("parent");
9        };
10      });
11    
12    $(".parent").click(function(event) {
13      event.preventDefault();
14      $(this).unbind('click');
15    });
16  }
17  
18
19  // This is the javascript to control the drawer menu behavior
20  $(function() {
21    $("#drawer-menu").mmenu({
22      extensions: ['pageshadow'],
23      offCanvas: {
24               position  : "right",
25            },
26      configuration: {
27          menuNodetype: "div",
28          pageNodetype: '<footer>'
29        }
30    });
31  });
32  
33
34  // Functions adds the collapsing archive behavior to archive list in sidebar
35  $('#blogArchiveList > ul > li:has(ul)').addClass("has-sub");
36  $('#blogArchiveList > ul > li a').click(function() {
37    var checkElement = $(this).next();
38    
39    $('#blogArchiveList li').removeClass('active');
40      $(this).closest('li').addClass('active');
41    
42    
43    if((checkElement.is('ul')) && (checkElement.is(':visible'))) {
44      $(this).closest('li').removeClass('active');
45      checkElement.slideUp('normal');
46  }
47
48  if((checkElement.is('ul')) && (!checkElement.is(':visible'))) {
49    $('#blogArchiveList ul ul:visible').slideUp('normal');
50    checkElement.slideDown('normal');
51  }
52
53  if (checkElement.is('ul')) {
54    return false;
55  } else {
56    return true;  
57  }
58  });
59
60
61  // Functions add class affix for navbar that sticks on scroll
62  $('#navigation').affix({
63    offset: {
64      top: 175,
65      bottom: function () {
66        return (this.bottom = $('.footer').outerHeight(true))
67      }
68    }
69  })
70  
71
72  // Functions add class to allow for responsive videos
73  $(function() {
74   // Run code for each element
75   $('.embed-responsive iframe').addClass('embed-responsive-item');
76  });
77  
78
79	// THIS SECTION MAKES THE PADDING AT THE TOP OF THE PAGE ADJUST TO THE NAV BAR HEIGHT
80	//$( window ).load(function() {
81		//$("#contentwrap").css({'padding-top':($("#navigation").outerHeight()+'px')});
82		//$("#homeContentWrap").css({'padding-top':($("#navigation").outerHeight()+'px')}); 
83        $("#navigation").addClass('affix-top')
84		
85		if($(window).width() >= 974){
86			
87			$("#page .pagebreak_left:first-child .pagebreak_left_img").css({'height':($("#page .pagebreak_left:first-child .pagebreak_left_content").outerHeight()+'px')});
88			$("#page .pagebreak_left:nth-child(2) .pagebreak_left_img").css({'height':($("#page .pagebreak_left:nth-child(2) .pagebreak_left_content").outerHeight()+'px')});
89			$("#page .pagebreak_left:nth-child(3) .pagebreak_left_img").css({'height':($("#page .pagebreak_left:nth-child(3) .pagebreak_left_content").outerHeight()+'px')});
90			$("#page .pagebreak_left:nth-child(4) .pagebreak_left_img").css({'height':($("#page .pagebreak_left:nth-child(4) .pagebreak_left_content").outerHeight()+'px')});
91			$("#page .pagebreak_left:nth-child(5) .pagebreak_left_img").css({'height':($("#page .pagebreak_left:nth-child(5) .pagebreak_left_content").outerHeight()+'px')});
92			$("#page .pagebreak_left:nth-child(6) .pagebreak_left_img").css({'height':($("#page .pagebreak_left:nth-child(6) .pagebreak_left_content").outerHeight()+'px')});
93			$("#page .pagebreak_left:nth-child(7) .pagebreak_left_img").css({'height':($("#page .pagebreak_left:nth-child(7) .pagebreak_left_content").outerHeight()+'px')});
94			$("#page .pagebreak_left:nth-child(8) .pagebreak_left_img").css({'height':($("#page .pagebreak_left:nth-child(8) .pagebreak_left_content").outerHeight()+'px')});
95			$("#page .pagebreak_left:nth-child(9) .pagebreak_left_img").css({'height':($("#page .pagebreak_left:nth-child(9) .pagebreak_left_content").outerHeight()+'px')});
96			$("#page .pagebreak_left:nth-child(10) .pagebreak_left_img").css({'height':($("#page .pagebreak_left:nth-child(10) .pagebreak_left_content").outerHeight()+'px')});
97						
98			$("#page .pagebreak_right:first-child .pagebreak_right_img").css({'height':($("#page .pagebreak_right:first-child .pagebreak_right_content").outerHeight()+'px')});
99			$("#page .pagebreak_right:nth-child(2) .pagebreak_right_img").css({'height':($("#page .pagebreak_right:nth-child(2) .pagebreak_right_content").outerHeight()+'px')});
100			$("#page .pagebreak_right:nth-child(3) .pagebreak_right_img").css({'height':($("#page .pagebreak_right:nth-child(3) .pagebreak_right_content").outerHeight()+'px')});
101			$("#page .pagebreak_right:nth-child(4) .pagebreak_right_img").css({'height':($("#page .pagebreak_right:nth-child(4) .pagebreak_right_content").outerHeight()+'px')});
102			$("#page .pagebreak_right:nth-child(5) .pagebreak_right_img").css({'height':($("#page .pagebreak_right:nth-child(5) .pagebreak_right_content").outerHeight()+'px')});
103			$("#page .pagebreak_right:nth-child(6) .pagebreak_right_img").css({'height':($("#page .pagebreak_right:nth-child(6) .pagebreak_right_content").outerHeight()+'px')});
104			$("#page .pagebreak_right:nth-child(7) .pagebreak_right_img").css({'height':($("#page .pagebreak_right:nth-child(7) .pagebreak_right_content").outerHeight()+'px')});
105			$("#page .pagebreak_right:nth-child(8) .pagebreak_right_img").css({'height':($("#page .pagebreak_right:nth-child(8) .pagebreak_right_content").outerHeight()+'px')});
106			$("#page .pagebreak_right:nth-child(9) .pagebreak_right_img").css({'height':($("#page .pagebreak_right:nth-child(9) .pagebreak_right_content").outerHeight()+'px')});
107			$("#page .pagebreak_right:nth-child(10) .pagebreak_right_img").css({'height':($("#page .pagebreak_right:nth-child(10) .pagebreak_right_content").outerHeight()+'px')});	
108			
109		}	
110		
111		$( "#myCarousel .active .slideDesc" ).each(function() {
112			var newHeight = 0, $this = $( this );
113			$.each( $this.children(), function() {
114				newHeight += $( this ).height();
115			});
116			$this.height( newHeight );
117		});		
118		
119		var maxHeight = 0;
120
121		$(".equal_height").each(function(){
122		   if ($(this).height() > maxHeight) { maxHeight = $(this).height(); }
123		});
124
125		$(".equal_height").height(maxHeight);
126		
127		 
128	//}); 
129	
130	$(window).scroll(function() {
131		/*if($(this).scrollTop() >= 175){} else {
132			$("#contentwrap").css({'padding-top':($("#navigation").outerHeight()+'px')});
133			$("#homeContentWrap").css({'padding-top':($("#navigation").outerHeight()+'px')});
134		}*/
135		if($(this).scrollTop() < 175){} else {
136			$("#navigation").addClass('affix');
137			$("#navigation").removeClass('affix-top');
138		} 
139		if($(this).scrollTop() >= 175){} else {
140			$("#navigation").addClass('affix-top');
141			$("#navigation").removeClass('affix');
142		}        
143	});
144	
145	$(window).resize(function() {
146		//$("#contentwrap").css({'padding-top':($("#navigation").outerHeight()+'px')});	
147		//$("#homeContentWrap").css({'padding-top':($("#navigation").outerHeight()+'px')});	
148		if($(window).width() >= 974){
149			
150			$("#page .pagebreak_left:first-child .pagebreak_left_img").css({'height':($("#page .pagebreak_left:first-child .pagebreak_left_content").outerHeight()+'px')});
151			$("#page .pagebreak_left:nth-child(2) .pagebreak_left_img").css({'height':($("#page .pagebreak_left:nth-child(2) .pagebreak_left_content").outerHeight()+'px')});
152			$("#page .pagebreak_left:nth-child(3) .pagebreak_left_img").css({'height':($("#page .pagebreak_left:nth-child(3) .pagebreak_left_content").outerHeight()+'px')});
153			$("#page .pagebreak_left:nth-child(4) .pagebreak_left_img").css({'height':($("#page .pagebreak_left:nth-child(4) .pagebreak_left_content").outerHeight()+'px')});
154			$("#page .pagebreak_left:nth-child(5) .pagebreak_left_img").css({'height':($("#page .pagebreak_left:nth-child(5) .pagebreak_left_content").outerHeight()+'px')});
155			$("#page .pagebreak_left:nth-child(6) .pagebreak_left_img").css({'height':($("#page .pagebreak_left:nth-child(6) .pagebreak_left_content").outerHeight()+'px')});
156			$("#page .pagebreak_left:nth-child(7) .pagebreak_left_img").css({'height':($("#page .pagebreak_left:nth-child(7) .pagebreak_left_content").outerHeight()+'px')});
157			$("#page .pagebreak_left:nth-child(8) .pagebreak_left_img").css({'height':($("#page .pagebreak_left:nth-child(8) .pagebreak_left_content").outerHeight()+'px')});
158			$("#page .pagebreak_left:nth-child(9) .pagebreak_left_img").css({'height':($("#page .pagebreak_left:nth-child(9) .pagebreak_left_content").outerHeight()+'px')});
159			$("#page .pagebreak_left:nth-child(10) .pagebreak_left_img").css({'height':($("#page .pagebreak_left:nth-child(10) .pagebreak_left_content").outerHeight()+'px')});		
160			
161			$("#page .pagebreak_right:first-child .pagebreak_right_img").css({'height':($("#page .pagebreak_right:first-child .pagebreak_right_content").outerHeight()+'px')});
162			$("#page .pagebreak_right:nth-child(2) .pagebreak_right_img").css({'height':($("#page .pagebreak_right:nth-child(2) .pagebreak_right_content").outerHeight()+'px')});
163			$("#page .pagebreak_right:nth-child(3) .pagebreak_right_img").css({'height':($("#page .pagebreak_right:nth-child(3) .pagebreak_right_content").outerHeight()+'px')});
164			$("#page .pagebreak_right:nth-child(4) .pagebreak_right_img").css({'height':($("#page .pagebreak_right:nth-child(4) .pagebreak_right_content").outerHeight()+'px')});
165			$("#page .pagebreak_right:nth-child(5) .pagebreak_right_img").css({'height':($("#page .pagebreak_right:nth-child(5) .pagebreak_right_content").outerHeight()+'px')});
166			$("#page .pagebreak_right:nth-child(6) .pagebreak_right_img").css({'height':($("#page .pagebreak_right:nth-child(6) .pagebreak_right_content").outerHeight()+'px')});
167			$("#page .pagebreak_right:nth-child(7) .pagebreak_right_img").css({'height':($("#page .pagebreak_right:nth-child(7) .pagebreak_right_content").outerHeight()+'px')});
168			$("#page .pagebreak_right:nth-child(8) .pagebreak_right_img").css({'height':($("#page .pagebreak_right:nth-child(8) .pagebreak_right_content").outerHeight()+'px')});
169			$("#page .pagebreak_right:nth-child(9) .pagebreak_right_img").css({'height':($("#page .pagebreak_right:nth-child(9) .pagebreak_right_content").outerHeight()+'px')});
170			$("#page .pagebreak_right:nth-child(10) .pagebreak_right_img").css({'height':($("#page .pagebreak_right:nth-child(10) .pagebreak_right_content").outerHeight()+'px')});	
171			
172		}
173		
174		if($(window).width() <= 974){
175			
176			$(".pagebreak_left_img").height('auto');
177			$(".pagebreak_right_img").height('auto');
178			
179		}
180		
181		$( "#myCarousel .active .slideDesc" ).each(function() {
182			var newHeight = 0, $this = $( this );
183			$.each( $this.children(), function() {
184				newHeight += $( this ).height();
185			});
186			$this.height( newHeight );
187		});	
188		
189		var maxHeight = 0;
190
191		$(".equal_height").each(function(){
192		   if ($(this).height() > maxHeight) { maxHeight = $(this).height(); }
193		});
194
195		$(".equal_height").height(maxHeight);
196		
197	}).resize();
198	
199	$('#myCarousel').on('slid.bs.carousel', function() {
200		$( "#myCarousel .active .slideDesc" ).each(function() {
201			var newHeight = 0, $this = $( this );
202			$.each( $this.children(), function() {
203				newHeight += $( this ).height();
204			});
205			$this.height( newHeight );
206		});	
207	});
208
209  
210
211  // Scroll to link behavior
212  // $('a').click(function(){
213  //     $('html, body').animate({
214  //         scrollTop: $('[name="' + $.attr(this, 'href').substr(1) + '"]').offset().top -120
215  //     }, 500);
216  //     return false;
217  // });
218
219
220	$(window).resize(function() {
221
222		var height = $("#navigation").outerHeight();
223		$('#homeContentWrap').css('padding-top', height);
224		$('#contentwrap').css('padding-top', height);
225	
226	}).resize();
227
228
229  /* 
230  *  Function calls the javascript and establishes settings for the featured image slider.
231  * 
232  *  Credit to Sachin N. at http://sachinchoolur.github.io/lightslider/ for the cool slider for posts
233  *  For documentation of all of the different settings that you can use visit http://sachinchoolur.github.io/lightslider/settings.html
234  *
235  */
236
237    var slider = $('#lightSlider').lightSlider({
238        pause: 4000,
239        autoWidth: true,
240        pager: false,
241        loop:true,
242        auto: true,
243        controls: false,
244        enableDrag: true
245
246    });
247    $('#goToPrevSlide').on('click', function () {
248        slider.goToPrevSlide();
249    });
250    $('#goToNextSlide').on('click', function () {
251        slider.goToNextSlide();
252    });
253
254    
255
256  
257      // var slideout = new Slideout({
258      //  'panel': document.getElementById('panel'),
259      //  'menu': document.getElementById('menu'),
260      //  'padding': 250,
261      //  'tolerance': 70,
262      //  'side': 'right'
263      // });
264
265      // // Toggle button
266      // document.querySelector('.toggle-button').addEventListener('click', function() {
267      //     slideout.toggle();
268      // });
269      // document.querySelector('.menu-mobile-menu-container').addEventListener('click', function(eve) {
270      //       //if (eve.target.nodeName === 'A') { slideout.close(); }
271      // });
272    
273
274});
275

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.