Show/hide element[Java]

chabuya

New Member
Hey there,
I want a div element only to show when you hover over an anchor of the main menu.
The problem is: This div is not a child of the menu, so i can't do it through simple hover and display css functions.

RNvsG.png

That's the menu.

r2KYQ.png

This is what should appear when you're hovering one of the items.
Also, I want a different div for the different menu anchors, because I dont think wordpress can read the category by a hover. And, if this wasn't enough, I have no idea how to build this so you can actually from the menu anchor to the subnav without it disappearing when you're not above the anchor.

Here's the website:www.chabuya.net

I already tried hundreds of show/hide scripts, solving this via css but nothing works for me.
I'd be grateful for any suggestions.

Thanks in advance,
Kevin
 

johnscott

New Member
Try using javascript getElementById() method and set the visibility of the div you want to hide. You'd have to put an onmousever="ShowDiv()"....or something like that..and a onmouseout="HideDiv()"

<a onmouseover='ShowDiv' onmouseout='HideDiv'>Link here</a>

<div id='div1'>some text here</div>


<script type='javascript'>

function ShowDiv()
{
getElementById ('div1').visibility=''; //shows the div
}

function HideDiv()
{
getElementById ('div1').visibility='none'; //hides the div
}
</script>


See if that works
 
Top