How would I compact this jQuery drop down menu code? I know you can use the Superfish plugin for this, but I’m more interested in learning the programming skills on this one. I know it would involve changing the “#navabout” IDs to something like “#Nav1” and the dropdown IDs to match, like “#drop1” and then running an array, possibly?
$('#navabout').hover(
function () {
$('#dropabout').show();
},
function () {
$('#dropabout').hide();
});
$('#navnews').hover(
function () {
$('#dropnews').show();
},
function () {
$('#dropnews').hide();
});
$('#navgroups').hover(
function () {
$('#dropgroups').show();
},
function () {
$('#dropgroups').hide();
});
$('#navemployee').hover(
function () {
$('#dropemployee').show();
},
function () {
$('#dropemployee').hide();
});
$('#navtools').hover(
function () {
$('#droptools').show();
},
function () {
$('#droptools').hide();
});
assign a “menu” class to all your menus.
then do