Skip to content

Instantly share code, notes, and snippets.

@damien
Created April 27, 2010 14:55
Show Gist options
  • Save damien/380821 to your computer and use it in GitHub Desktop.
Save damien/380821 to your computer and use it in GitHub Desktop.
A simple utility JQuery plugin that converts a select element generated from `wp_dropdown_categories` into a classic jump menu/drop down navigation.
;(function($) {
$.fn.jumpMenu = function(options) {
// Creatues a jumpmenu using a form containing wp_dropdown_categories() and a submit input
return this.each(function() {
var form = $(this);
$('input[type=submit]', form).hide();
var categories = $('select#cat', form);
categories.change(function() {
form.submit();
});
});
};
})(jQuery);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment