summaryrefslogtreecommitdiffstats
path: root/source/javascripts/navigation.js
blob: 652aafa73ad650aa35c84fd3882aa6734b338ac0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
(function($){
	var appends = '<option>Menu</option>';

	$('.menu .main > li').each(function(){
		var link = $(this).children('a');
		appends += '<option value="'+link.attr('href')+'">'+link.html()+'</option>';
		$(this).find('li').each(function(){
			var link = $(this).children('a');
			appends += '<option value="'+link.attr('href')+'">- '+link.html()+'</option>';
		});
	});

	$('nav.menu').append('<select>'+appends+'</select>').on('change', 'select', function(){
		location.href = $(this).val();
	});
})(jQuery);