UPDATE
I noticed that this only happens when I use slideUp / Down. If I use show / hide everythings OK
END UPDATE
On my site, I am engaged in development / design, I have 2 questions.
In IE7, the sliding menu does not seem to be displayed until I move the abit mouse.
alt text http://img27.imageshack.us/img27/4422/7282009105215pm.png
In IE8, after the menu slips, the margin seems to be deleted.
alt text http://img27.imageshack.us/img27/4592/7282009105247pm.png
JS (if required)
$ (function () {
$ ("# mainNav li: has (ul)> a"). addClass ("hasMore");
$ ("# mainNav li"). hoverIntent (menuOn, menuOff);
$ .each ($ ("# mainNav a.active"). parents ("li"), function () {
$ (this) .children ("a: first"). addClass ("active");
});
$ ("# mainNav"). mouseleave (function () {
$ ("ul", this) .slideUp (200);
$ (". open", this) .removeClass ("open");
});
});
function menuOn () {
var childUl = $ (this) .children ("ul");
if (childUl.length) {
childUl.slideDown (200);
$ (this) .addClass ("open");
$ ("ul", $ (this) .closest ("li"). siblings ("li")). slideUp (200);
$ (this) .closest ("li"). siblings ("li"). removeClass ("open");
}
}
function menuOff () {
}
CSS
#mainNav, #mainNav ul {
list-style: none;
padding: 0;
margin: 0;
}
#mainNav ul {
display: none;
}
#mainNav li {
position: relative;
}
#mainNav li ul {
margin: 2px 0 2px 5px;
background-color: #282a33;
}
#mainNav a:link, #mainNav a:visited {
display: block;
padding: 5px 10px;
margin-bottom: 2px;
color: #282a33;
background-color: #ffe7a6;
text-decoration: none;
}
#mainNav a:hover, #mainNav a:active {
background-color: #e6c468;
}
#mainNav > li.open > a.hasMore {
background-color: #e6c468;
}
#mainNav > li > a.active {
color: #fff;
background-color: #fa8000 !important;
font-weight: bold;
}
#mainNav li li a:link, #mainNav li li a:active, #mainNav li li a:visited, #mainNav li li a:hover {
background-color: transparent !important;
padding: 2px 5px;
font-family: Georgia, Garamond, "Times New Roman", serif;
font-size: 11px;
font-weight: bold;
color: white;
}
#mainNav li li a:hover, #mainNav li li a:active {
color: #ffe7a6;
}
#mainNav li li a.active {
color: #fa8000;
}
#mainNav a.hasMore {
background-image: url(../images/section_collapsed.png);
background-repeat: no-repeat;
background-position: right center;
}
#mainNav a.active.hasMore,
#mainNav a.hasMore:hover,
#mainNav li li > a.hasMore {
background-image: url(../images/section_collapsed2.png);
}
#mainNav li.open > a.active.hasMore,
#mainNav li.open > a.hasMore {
background-image: url(../images/section_expanded2.png);
}