|
|
#1 |
|
New Member
![]() Join Date: Feb 2010
Posts: 1
|
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. ![]() That's the menu. ![]() 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 |
|
|
|
|
|
#2 |
|
New Member
![]() Join Date: Jan 2010
Location: Edmonton, AB
Posts: 21
|
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 |
|
|
|
![]() |
| Thread Tools | |
| Display Modes | |
|
|