PageSourceSearch

https://platzkerealestategroup.com/wp-content/plugins/aios-all-wid…/views/lib/js/aios-mobile-header.js

js platzkerealestategroup.com collected 2026-10-09 22:16:35 UTC 2,356 bytes, 107 lines download raw bytes

1( function($) {
2
3	$.prototype.aiosMobileHeader = function(settings) {
4		
5		var defaults = {
6			height: false
7		}
8		
9		settings = $.extend(defaults,settings);
10		
11		this.each( function(i,v) {
12			
13			Header(jQuery(v),settings);
14			
15		});
16		
17	}
18	
19	function Header(object,settings) {
20		
21		var object = jQuery(object);
22		var offsetAnchorMarker = '_aiosmobilepackheaderanchoroffset' + Math.random(); 
23		var newlyRefreshed = true;
24		var offsetPattern = /_aiosmobilepackheaderanchoroffset(\d|\.)*$/g;
25		
26		function _construct() {
27			
28			correctInPageLinks();
29			enablePhoneList();
30			
31		}
32		
33		function enablePhoneList() {
34			
35			var trigger = object.find(".amh-header-phone-list-trigger");
36			var list = object.find(".amh-header-phone-list");
37			var menuTrigger = object.find(".amh-navigation-trigger");
38			
39			trigger.click( function() {
40				if ( list.hasClass("visible") ) {
41					list.slideUp();
42					list.removeClass("visible");
43				}
44				else {
45					if ( jQuery(".aios-mobile-pack-navigation-trigger-active").length > 0 ) {
46						object.find(".amh-navigation-trigger").trigger("click");
47					}
48					list.stop().slideDown();
49					list.addClass("visible");
50				}
51			});
52			
53			menuTrigger.click( function() {
54				list.slideUp();
55				list.removeClass("visible");
56			});
57
58		}
59		
60		/*
61		 * Correct in-page links
62		 * Credits: http://stackoverflow.com/questions/17534661/make-anchor-link-go-some-pixels-above-where-its-linked-to 
63		 */
64		function correctInPageLinks() {
65			
66			jQuery(window).on("hashchange", function () {
67				offsetAnchor();
68			});
69
70			window.setTimeout(function() {
71				cleanAnchor();
72			}, 1);
73			
74		}
75		
76		function offsetAnchor() {
77			
78			if(location.hash.length > 0 && location.hash.search(offsetAnchorMarker) == -1 ) {
79				if ( isHeaderVisible() ) {
80					
81					var headerHeight = !settings.height ? object.height() : settings.height;
82					
83					jQuery(window).scrollTop( (jQuery(window).scrollTop() - headerHeight) );
84					location.hash += offsetAnchorMarker;
85				}
86			}
87		}
88		
89		function cleanAnchor() {
90			if (location.hash.length > 0 && newlyRefreshed ) {
91				if ( isHeaderVisible() ) {
92					var originalHash = location.hash.replace(offsetPattern,'');
93					location.hash = originalHash;
94					newlyRefreshed = false;
95				}
96			}
97		}
98		
99		function isHeaderVisible() {
100			return object.is(":visible");
101		}
102		
103		_construct();
104		
105	}
106	
107})(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.