fixed mobile navigation
This commit is contained in:
parent
75cc24c8d6
commit
49a27c929d
@ -1,17 +1,15 @@
|
|||||||
function getNav() {
|
function getNav() {
|
||||||
var mobileNav = $('nav[role=navigation] fieldset[role=search]').after('<fieldset class="mobile-nav"></fieldset>').next().append('<select></select>');
|
var mainNav = $('ul.main-navigation, ul[role=main-navigation]').before('<fieldset class="mobile-nav">')
|
||||||
mobileNav.children('select').append('<option value="">Navigate…</option>');
|
var mobileNav = $('fieldset.mobile-nav').append('<select>');
|
||||||
$('ul[role=main-navigation]').addClass('main-navigation');
|
mobileNav.find('select').append('<option value="">Navigate…</option>');
|
||||||
$('ul.main-navigation a').each(function(i, link) {
|
var addOption = function(i, option) {
|
||||||
mobileNav.children('select').append('<option value="'+link.href+'">» '+link.text+'</option>');
|
mobileNav.find('select').append('<option value="' + this.href + '">» ' + $(this).text() + '</option>');
|
||||||
});
|
}
|
||||||
$('ul.subscription a').each(function(i, link) {
|
mainNav.find('a').each(addOption);
|
||||||
mobileNav.children('select').append('<option value="'+link.href+'">» '+link.text+'</option>');
|
$('ul.subscription a').each(addOption);
|
||||||
});
|
mobileNav.find('select').bind('change', function(event) {
|
||||||
mobileNav.children('select').bind('change', function(event) {
|
|
||||||
if (event.target.value) { window.location.href = event.target.value; }
|
if (event.target.value) { window.location.href = event.target.value; }
|
||||||
});
|
});
|
||||||
mobileNav.children('select').val('');
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function addSidebarToggler() {
|
function addSidebarToggler() {
|
||||||
|
Loading…
Reference in New Issue
Block a user