This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
jQuery(document).ready(function($){ | |
// Create the dropdown base | |
$('<div class="mobile-menu"><form><select onchange="if (this.value) window.location.href=this.value" /></form></div>').prependTo("#wrap"); | |
// Create default option "Go to..." | |
$("<option />", { | |
"selected": "selected", | |
"value" : "", | |
"text" : "Go to..." | |
}).appendTo(".mobile-menu select"); | |
// Populate dropdown with menu items | |
$("#nav a").each(function() { | |
var el = $(this); | |
$("<option />", { | |
"value" : el.attr("href"), | |
"text" : el.text() | |
}).appendTo(".mobile-menu select"); | |
}); | |
}); |