Hi there... help :=)
I have a menu <li>
that when hovered slides a panel down which contains a submenu. (fixed)
Now I need to fill that submenu with content that changes depending on which of the menu items is hovered.(fixed)
last problem: I can only make the content-change happen if .click is used instead of .hover ... - is there an issue using 2 x .hover on same element?
<html>
[.......]
<body>
<div id="head_menu">
<div id="navmain">
<ul>
<li id="menu1"><a class="open" href="#">Menu 1</a></li>
<li id="menu2"><a class="open" href="#">Menu 2</a></li>
</ul>
</div>
</div>
<div id="toppanel">
<div id="panel">
<div id="subcontent_wrap">
<div id="submenu1" style="display:none;">
<div class="subcontent_container">
<h1>Head</h1>
<p>content </p>
</div>
<div class="subcontent_container">more content</div>
</div>
<div id="submenu2" style="display:none;">
<div class="subcontent_container">
<h1>Head</h1>
<p>content </p>
</div>
<div class="subcontent_container">more content</div>
</div>
</div>
</div>
<script>
var slideOpen = false;
var toggling = false;
function slidein() {
clearTimeout(toggling);
if (!slideOpen)
$("#panel").slideDown("fast");
else
$("#panel").show();
slideOpen = true;
$(this).addClass("active");
return false;
}
function slideout() {
if (!slideOpen)
$("#panel").hide();
else
$("#panel").slideUp("fast");
slideOpen = false;
$(this).removeClass("active");
return false;
}
function unhover() {
clearTimeout(toggling);
toggling = setTimeout(slideout, 300);
}
$(".open").hover(slidein, unhover);
$(function () {
$("#navmain li").click(function () {
var $this = $(this);
$("#subcontent_wrap div").hide();
$("#submenu" + $this.attr("id").replace(/menu/, "")).show();
$("#navmain li").css("font-weight", "normal");
$this.css("font-weight", "bold");
});
});
</script>
</body>
</html>