PageSourceSearch

https://builtdublin.com/wp-content/themes/construct/js/jquery.mobileMenu.js

js builtdublin.com collected 2026-10-02 07:15:30 UTC 1,734 bytes, 73 lines download raw bytes

1(function($){
2$.fn.mobileMenu = function(options) {
3	
4	var defaults = {
5			defaultText: 'Navigate to...',
6			className: 'select-menu',
7			subMenuClass: 'sub-menu',
8			subMenuDash: '–'
9		},
10		settings = $.extend( defaults, options ),
11		el = $(this);
12	
13	this.each(function(){
14		// ad class to submenu list
15		el.find('ul').addClass(settings.subMenuClass);
16
17		// Create base menu
18		$('<select />',{
19			'class' : settings.className
20		}).insertAfter( el );
21
22		// Create default option
23		$('<option />', {
24			"value"		: '#',
25			"text"		: settings.defaultText
26		}).appendTo( '.' + settings.className );
27
28		// Create select option from menu
29		el.find('a').each(function(){
30			var $this = $(this),
31				optText	= '&nbsp;' + $this.text(),
32				optSub = $this.parents( '.' + settings.subMenuClass ),
33				len = optSub.length,
34				dash;
35			
36			// if menu has sub menu
37			if( $this.parents('ul').hasClass( settings.subMenuClass ) ) {
38				dash = Array( len+1 ).join( settings.subMenuDash );
39				optText = dash + optText;
40			}
41
42			// Now build menu and append it
43			$('<option />', {
44				"value"	: this.href,
45				"html"	: optText,
46				"selected" : (this.href == window.location.href)
47			}).appendTo( '.' + settings.className );
48
49		}); // End el.find('a').each
50
51		// Change event on select element
52		$('.' + settings.className).change(function(){
53			var locations = $(this).val();
54			if( locations !== '#' ) {
55				window.location.href = $(this).val();
56			};
57		});
58
59	}); // End this.each
60
61	return this;
62
63};
64})(jQuery);
65
66jQuery(document).ready(function($) {
67	var width = $(window).width();
68	if(width < 680) {
69		$('#primary-menu .menu').mobileMenu();
70		$('#primary-menu .menu').hide();
71		$('#primary-menu').css({'float':'none','left':'auto'});
72	}
73});

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.