Live example is here
What my problems are:
- when moving mouse from sub menu over minus sign, the sub menu fades in again (this should not occur)
- when leaving menu outside the sub menu by moving mouse upwards or leftwards the plus sign, the sub menu does not fade out
These problems could be managed by exchanging z-index of plus sign and sub menu. But then the minus sign is not displayed in the style I want it to be displayed (because it lays behind the semi transparent sub menu).
Relevant JS code is:
$(document).ready(function() {
if ($(".nav").length) {
$(".nav ul ul").css({ opacity: 0.9 }).mouseleave(function(e) {
e.stopPropagation();
$(this).fadeOut().parent().prev().children("div").html("+").css({ lineHeight: "30px", paddingBottom: 0 });
});
$(".nav > ul").find("li:first").each(function() {
$(this).append($("<div>").html("+").mouseenter(function(e) {
e.stopPropagation();
$(this).html("–").css({ lineHeight: "26px", paddingBottom: "4px" }).parent().next().children("ul").fadeIn();
}));
});
}
});