PageSourceSearch

https://medicalonmiami.com.au/wp-content/themes/Miami/js/scripts.js?ver=1.0.0

js medicalonmiami.com.au collected 2026-10-06 17:01:50 UTC 13,590 bytes, 521 lines download raw bytes

1/**
2
3 * File navigation.js.
4
5 *
6
7 * Handles toggling the navigation menu for small screens and enables TAB key
8
9 * navigation support for dropdown menus.
10
11 */
12
13( function() {
14
15	var container, button, menu, links, subMenus, i, len;
16
17
18
19	container = document.getElementById( 'site-navigation' );
20
21	if ( ! container ) {
22
23		return;
24
25	}
26
27
28
29	button = container.getElementsByTagName( 'button' )[0];
30
31	if ( 'undefined' === typeof button ) {
32
33		return;
34
35	}
36
37
38
39	menu = container.getElementsByTagName( 'ul' )[0];
40
41
42
43	// Hide menu toggle button if menu is empty and return early.
44
45	if ( 'undefined' === typeof menu ) {
46
47		button.style.display = 'none';
48
49		return;
50
51	}
52
53
54
55	menu.setAttribute( 'aria-expanded', 'false' );
56
57	if ( -1 === menu.className.indexOf( 'nav-menu' ) ) {
58
59		menu.className += ' nav-menu';
60
61	}
62
63
64
65	button.onclick = function() {
66
67		if ( -1 !== container.className.indexOf( 'toggled' ) ) {
68
69			container.className = container.className.replace( ' toggled', '' );
70
71			button.setAttribute( 'aria-expanded', 'false' );
72
73			menu.setAttribute( 'aria-expanded', 'false' );
74
75		} else {
76
77			container.className += ' toggled';
78
79			button.setAttribute( 'aria-expanded', 'true' );
80
81			menu.setAttribute( 'aria-expanded', 'true' );
82
83		}
84
85	};
86
87
88
89	// Get all the link elements within the menu.
90
91	links    = menu.getElementsByTagName( 'a' );
92
93	subMenus = menu.getElementsByTagName( 'ul' );
94
95
96
97	// Set menu items with submenus to aria-haspopup="true".
98
99	for ( i = 0, len = subMenus.length; i < len; i++ ) {
100
101		subMenus[i].parentNode.setAttribute( 'aria-haspopup', 'true' );
102
103	}
104
105
106
107	// Each time a menu link is focused or blurred, toggle focus.
108
109	for ( i = 0, len = links.length; i < len; i++ ) {
110
111		links[i].addEventListener( 'focus', toggleFocus, true );
112
113		links[i].addEventListener( 'blur', toggleFocus, true );
114
115	}
116
117
118
119	/**
120
121	 * Sets or removes .focus class on an element.
122
123	 */
124
125	function toggleFocus() {
126
127		var self = this;
128
129
130
131		// Move up through the ancestors of the current link until we hit .nav-menu.
132
133		while ( -1 === self.className.indexOf( 'nav-menu' ) ) {
134
135
136
137			// On li elements toggle the class .focus.
138
139			if ( 'li' === self.tagName.toLowerCase() ) {
140
141				if ( -1 !== self.className.indexOf( 'focus' ) ) {
142
143					self.className = self.className.replace( ' focus', '' );
144
145				} else {
146
147					self.className += ' focus';
148
149				}
150
151			}
152
153
154
155			self = self.parentElement;
156
157		}
158
159	}
160
161} )();
162
163
164
165
166
167
168
169(function ($, root, undefined) {
170
171	
172
173	$(function () {
174
175		
176
177		'use strict';
178
179		
180
181	
182
183		$( document ).ready(function() {
184
185			/*
186			$('.menu-toggle').click(function(){
187				$(this).toggleClass('toggled');
188				$('.main-navigation').toggleClass('toggled');
189			});
190			*/
191
192			if( $('body').hasClass('home') ) {
193			  $(window).scroll(function(){
194
195  
196			    AOS.init();
197
198			    var scrollTop = $(this).scrollTop();
199			    var provide = $(".we-provide__wrap").offset();
200			    var sectionInfo = $(".section-info").offset();
201			    var contact = $(".contact-wrap").offset();
202			    var speciality = $(".speciality-wrap").offset();
203			    var appointment = $(".appointment-wrap").offset();
204
205			    //only index
206
207			    if (scrollTop >= sectionInfo.top - 200 && scrollTop <= provide.top - 200) {
208			      $(".section-info .circle").css({"background-color": "#FAE5E5"});
209			    } else {
210			      $(".section-info .circle").css({"background-color": "#F6F6F6"});
211			    }
212
213			    if (scrollTop >= provide.top - 150 && scrollTop <= contact.top) {
214			      $(".link-line").addClass("link-line__active");
215			    } else {
216			      $(".link-line").removeClass("link-line__active");
217			    }
218
219			    if (scrollTop >= speciality.top - 200  && scrollTop <= appointment.top -200 ) {
220			      $(".speciality-wrap .circle").css({"background-color": "#FAE5E5"});
221			    } else {
222			      $(".speciality-wrap .circle").css({"background-color": "#F6F6F6"});
223			    }
224
225			  });
226			}
227
228			if( $('body').hasClass('page-template-provide') ) {
229				$(window).scroll(function(){
230
231				  var scrollTop = $(this).scrollTop();
232				  var provide = $(".we-provide__wrap").offset();
233				  var sectionInfo = $(".section-info").offset();
234
235				  //only index
236
237				  if (scrollTop >= sectionInfo.top - 200) {
238				    $(".section-info .circle").css({"background-color": "#FAE5E5"});
239				  } else {
240				    $(".section-info .circle").css({"background-color": "#F6F6F6"});
241				  }
242
243				});
244			}
245
246			if( $('body').hasClass('page-template-appointment') ) {
247				$(window).scroll(function(){
248
249				  var scrollTop = $(this).scrollTop();
250				  var insta = $(".instagram-wrap").offset();
251				  var hours = $(".hours-wrap").offset();
252
253				  $(".btn-pin").on("click", function(){
254				    $('html, body').stop().animate({
255				      scrollTop: $(".contact-wrap").offset().top
256				  }, 500);
257				  });
258
259				  if (scrollTop > 10) {
260				    $(".nav-wrap").addClass("nav-sticky");
261				    $(".nav-cta").addClass("nav-cta__sticky");
262				    $(".menu").addClass("menu-sticky");
263				    $(".logo").addClass("logo-sticky");
264				    $(".nav-book").css({"opacity":"1"});
265
266				  } else {
267				    $(".nav-wrap").removeClass("nav-sticky");
268				    $(".nav-cta").removeClass("nav-cta__sticky");
269				    $(".menu").removeClass("menu-sticky");
270				    $(".logo").removeClass("logo-sticky");
271				    $(".nav-book").css({"opacity":"0"});
272				  }
273
274				  if (scrollTop >= insta.top - 180  && scrollTop <= hours.top - 50 ) {
275				    $(".link-line").addClass("link-line__active");
276				  } else {
277				    $(".link-line").removeClass("link-line__active");
278				  }
279
280				});
281			}
282
283
284			// FAQ template
285			$(".faq-nav li:first-child").addClass('right-link faq-active');
286			$(".faq-nav li:nth-child(2)").addClass('fees-link');
287			$(".faq-nav li:nth-child(3)").addClass('forums-link');
288			$(".faq-nav li:nth-child(4)").addClass('appointment-link');
289
290			$(".faq-wrap > div:nth-child(2)").addClass('rights-tab');
291			$(".faq-wrap > div:nth-child(3)").addClass('fees-tab');
292			$(".faq-wrap > div:nth-child(4)").addClass('forums-tab');
293			$(".faq-wrap > div:nth-child(5)").addClass('appointment-tab');
294
295			$(".faq-single__wrap").on("click", function(){
296			  $(this).find(".faq-answer").stop().slideToggle();
297			  $(this).toggleClass("rotate-top");
298			});
299
300			$(".right-link").on("click", function(){
301			  $(".fees-tab, .appointment-tab, .forums-tab").slideUp();
302			  $(".rights-tab").slideDown();
303			  $(".fees-link, .forums-link, .appointment-link").removeClass("faq-active");
304			  $(this).addClass("faq-active");
305			});
306
307			$(".fees-link").on("click", function(){
308			  $(".appointment-tab, .forums-tab, .rights-tab").slideUp();
309			  $(".fees-tab").slideDown();
310			  $(".right-link, .forums-link, .appointment-link").removeClass("faq-active");
311			  $(this).addClass("faq-active");
312			});
313
314			$(".forums-link").on("click", function(){
315			  $(".appointment-tab, .rights-tab, .fees-tab").slideUp();
316			  $(".forums-tab").slideDown();
317			  $(".fees-link, .right-link, .appointment-link").removeClass("faq-active");
318			  $(this).addClass("faq-active");
319			});
320
321			$(".appointment-link").on("click", function(){
322			  $(".forums-tab, .rights-tab, .fees-tab").slideUp();
323			  $(".appointment-tab").slideDown();
324			  $(".fees-link, .right-link, .forums-link").removeClass("faq-active");
325			  $(this).addClass("faq-active");
326			});
327
328			// for provide-list wrapp 3 elements
329			var divs = $(".provide-list > a");
330			for(var i = 0; i < divs.length; i+=3) {
331			  divs.slice(i, i+3).wrapAll("<div class='provide-list__row'></div>");
332			}
333
334			//for team - person description bottom
335			/*
336			$(".team-person-col:nth-child(3n-1)").addClass('team-person-col2');
337			$(".team-person-col2").each(function() {
338			  var el1 = $(this).find('.person-icons');
339			  $(this).find('.team-person').prepend(el1);
340			  var el2 = $(this).find('.person-img');
341			  $(this).find('.person-title').addClass('person-title__bottom').after(el2);
342			});
343			*/
344
345			//for we-provide__tabs
346			$(".we-provide__tabs > div:nth-child(2n) > div:first-child").addClass('col-md-push-6 col-sm-push-6');
347			$(".we-provide__tabs > div:nth-child(2n) > div:nth-child(2)").addClass('col-sm-pull-6 col-sm-6 col-xs-12');
348
349			//for contact page icons hover
350			$( ".contact-icons a" ).hover(function() {
351			    var url2 = $( this ).find('.contact-img').attr('data-hover');
352			    $( this ).find('.contact-img').css('background-image', 'url('+url2+')');
353			  }, function() {
354			  	var url = $( this ).find('.contact-img').attr('data-url');
355			  	$( this ).find('.contact-img').css('background-image', 'url('+url+')');
356			  }
357			);
358
359
360			// slider
361			$('.slider-wrap').slick({
362				dots: true,
363				infinite: true,
364				//speed: 500,
365				fade: true,
366				cssEase: 'linear',
367				autoplay: false,
368				//autoplaySpeed: 3000,
369				arrows: false,
370				pauseOnHover: false
371			});
372
373			// scroll
374
375			$(window).scroll(function(){
376
377				var scrollTop = $(this).scrollTop();
378				var provide = $(".we-provide__wrap").offset();
379				var sectionInfo = $(".section-info").offset();
380				var contact = $(".contact-wrap").offset();
381				var speciality = $(".speciality-wrap").offset();
382				var appointment = $(".appointment-wrap").offset();
383
384				$(".btn-pin").on("click", function(){
385					$('html, body').stop().animate({
386		        scrollTop: $(".contact-wrap").offset().top
387		    }, 500);
388				});
389
390				if (scrollTop > 10) {
391					$(".nav-wrap").addClass("nav-sticky");
392					$(".nav-cta").addClass("nav-cta__sticky");
393					$(".menu").addClass("menu-sticky");
394					$(".logo").addClass("logo-sticky");
395					$(".nav-book").css({"opacity":"1"});
396
397				} else {
398					$(".nav-wrap").removeClass("nav-sticky");
399					$(".nav-cta").removeClass("nav-cta__sticky");
400					$(".menu").removeClass("menu-sticky");
401					$(".logo").removeClass("logo-sticky");
402					$(".nav-book").css({"opacity":"0"});
403				}
404
405			});
406
407			//menu
408			$(".menu").click(function() {
409				$(".menu-icon").toggle();
410				$(".menu-close").toggle();
411				$('nav').toggleClass("nav-expanded");
412				$(".nav-btn, .nav-book").toggle();
413				$(".menu").show();
414			});
415
416			//menu lang
417			$( ".lang-item" ).each( function(){
418				if(!$(this).hasClass('current-lang')) { $(this).addClass('lang-it'); }
419				if($(this).hasClass('current-lang')) { $(this).parent().prepend(this); }
420			});
421			$(".c-lang").click(function() {
422				$(this).parent().find('.lang-it').slideToggle();
423				$(this).toggleClass('open');
424			});
425
426
427			// team filter
428			var $container2 = $('.team-row');
429			$container2.isotope({ 
430				filter: '.team-person-col',
431				layoutMode: 'fitRows'
432			});
433			$('.team-cat a').click(function(){
434			  //console.log('click a');
435			  $('.team-cat a').removeClass('active');
436        	  $(this).addClass('active');
437			  var selector = $(this).attr('href');
438			  $container2.isotope({ filter: selector });
439			  return false;
440			});
441
442			if($('body').hasClass('page-template-team')) {
443				window.hashName = window.location.hash;
444				$('html, body').animate({scrollTop: $(window.hashName).offset().top}, 2000);
445				//hashName.replace('#','');
446				//hashName.split("#")[1];
447				$(".team-cat").find('[data-active="'+hashName+'"]').click();
448			}
449			
450		});  
451
452		$(window).load(function() {
453
454			// Blog index posts filter
455			var $container = $('.izotope_container');
456			$container.isotope({ 
457				filter: '.izotope_item',
458				sortBy: 'time',
459  				sortAscending: true,
460				  getSortData: {
461				    time: function ( elem  ) {
462				       return $(elem).find('.izotope_item').attr('data-time');
463				    }
464				  }
465			});
466			$('#filters a.but').click(function(){
467			  $('#filters a.but').removeClass('active');
468        	  $(this).addClass('active');
469			  var selector = $(this).attr('data-filter');
470			  $container.isotope({ filter: selector });
471			  return false;
472			});
473			$('#filter-select').on('change', function() {
474			  	var select = this.value;
475			  	select = select === 'false' ? false : select;
476			  	$container.isotope({ sortBy: 'time', sortAscending: select });
477			});
478
479			//for instagram arrow
480			setTimeout (function(){
481				$(".eapps-instagram-feed-posts-slider-next, .eapps-instagram-feed-posts-slider-prev").css('display', 'none');
482				if(!$(".eapps-instagram-feed-posts-slider-next").hasClass('eui-slider-arrow-enabled')) {$(".insta-right").hide();} else {$(".insta-right").show();}
483				if(!$(".eapps-instagram-feed-posts-slider-prev").hasClass('eui-slider-arrow-enabled')) {$(".insta-left").hide();} else {$(".insta-left").show();}
484			}, 800);
485			$(".insta-right").click(function() {
486				$(".eapps-instagram-feed-posts-slider-next").click();
487				setTimeout (function(){
488					if(!$(".eapps-instagram-feed-posts-slider-next").hasClass('eui-slider-arrow-enabled')) {$(".insta-right").hide();} else {$(".insta-right").show();}
489					if(!$(".eapps-instagram-feed-posts-slider-prev").hasClass('eui-slider-arrow-enabled')) {$(".insta-left").hide();} else {$(".insta-left").show();}
490				}, 800);
491			});
492			$(".insta-left").click(function() {
493				$(".eapps-instagram-feed-posts-slider-prev").click();
494				setTimeout (function(){
495					if(!$(".eapps-instagram-feed-posts-slider-next").hasClass('eui-slider-arrow-enabled')) {$(".insta-right").hide();} else {$(".insta-right").show();}
496					if(!$(".eapps-instagram-feed-posts-slider-prev").hasClass('eui-slider-arrow-enabled')) {$(".insta-left").hide();} else {$(".insta-left").show();}
497				}, 800);
498			});
499
500
501			/*
502			function heightDetect() {
503				var h = $(".class1").height();
504				$(".class2").height(h);
505			};
506			heightDetect();
507			*/
508
509			$(".team-person .person-title .title-name").equalHeights();
510			$(window).resize(function(){
511				$(".team-person .person-title .title-name").removeAttr("style");
512				$(".team-person .person-title .title-name").equalHeights();
513			});
514			
515
516		}); 
517
518});
519
520})(jQuery, this);
521

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.