Web Design Forum  
 
Go Back   Web Design Forum > Web Software > Scripts

Reply
 
LinkBack Thread Tools Display Modes
Old 02-20-2010, 07:15 PM   #1
New Member
 
Join Date: Feb 2010
Posts: 1
Question Show/hide element[Java]

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
chabuya is offline   Reply With Quote


Old 02-20-2010, 09:54 PM   #2
New Member
 
Join Date: Jan 2010
Location: Edmonton, AB
Posts: 21
Default

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
__________________
Regards,

John Scott
Edmonton Web Design And Development
johnscott is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT. The time now is 09:18 PM.


Camera Forum - Computer Forum - Web Design Forum

Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2012, vBulletin Solutions, Inc.
Content Relevant URLs by vBSEO 3.6.0 ©2011, Crawlability, Inc.