The following code works successfully, except the menu slideDown only works on the second hover over my menu item. The first time it appears instantly, like no jQuery is applied at all the first time around.
$(document).ready( function() {
// animate dropdown menus
$('#wp-admin-bar ul li').hover(
function () {
//show submenu
$('ul', this).slideDown(180);
},
function () {
//hide submenu
$('ul', this).slideUp(180);
}
);
});
The weird thing is if I add
$(this).addClass("hover");
The class is added immediately - on the the first hover.
I'm a little baffled by this.