Programming
dynamic hover menu.

Question Description

need a jquery script for a dynamic hover menu...

Student has agreed that all tutoring, explanations, and answers provided by the tutor will be used to help in the learning process and in accordance with Studypool's honor code & terms of service.

Final Answer

hi garry,

hope this will help

$(document).ready(function(){

// Remove the class of child and grandchild
// This removes the CSS 'falback'
$("#nav ul.child").removeClass("child");
$("#nav ul.grandchild").removeClass("grandchild");

// When a list item that contains an unordered list
// is hovered on
$("#nav li").has("ul").hover(function(){

//Add a class of current and fade in the sub-menu
$(this).addClass("current").children("ul").fadeIn();
}, function() {

// On mouse off remove the class of current
// Stop any sub-menu animation and set its display to none
$(this).removeClass("current").children("ul").stop(true, true).css("display", "none");
});

)};

Rice University

Anonymous
Great! 10/10 would recommend using Studypool to help you study.

Studypool
4.7
Trustpilot
4.5
Sitejabber
4.4