// Populate dropdown with menu items
jQuery(“#main-menu a”).each(function() {
var el = jQuery(this);
jQuery(““, {
“value” : el.attr(“href”),
“text” : el.text()
}).appendTo(“#main-menu-wrapper select”);
});
// To make dropdown actually work
jQuery(“#main-menu-wrapper select”).change(function() {
window.location = jQuery(this).find(“option:selected”).val();
});
Author
Posts
Viewing 1 post (of 1 total)
The forum ‘JavaScript’ is closed to new topics and replies.