CSS Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsWeb DesignCSS Help

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old November 9th, 2003, 01:31 PM
geek-fx geek-fx is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Nov 2003
Posts: 3 geek-fx User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Send a message via AIM to geek-fx
CSS Menu (DIV and LINK conflict)

Here is an example of what I did...


Here is the source code for all the functions I used (JS):

function closeMenu(menu)
{
if (menu == menu1)
{
document.getElementById("menu1").style.visibility="hidden";
}
}
function showMenu(menu)
{
if (menu == menu1)
{
document.getElementById("menu1").style.visibility="visible";
}
}


Now I will create my menu (invisible):

<div style="visibility: hidden;" id="menu1" onMouseOut="closeMenu(menu1)">

<a href="#">menuItem</a><br>
<a href="#">menuItem</a><br>

</div>


That menu will be invisible until someone puts their mouse over this following link which will make it visible:

<a onMouseOver="showMenu(menu1)">menuItem</a>


And as you can see the hidden menu will show when the user's cursor goes over the link; the div will disapear when the mouse leave's the area. This code works very well with one exception: When a user puts their mouse over the LINKs in a menu div, for some reason it closes (becomes invisible).

Can anyone take a guess at why this is happening? All attempts appreciated.

Reply With Quote
  #2  
Old November 9th, 2003, 01:49 PM
flatlander flatlander is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Sep 2003
Posts: 37 flatlander User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 5
Is this what you want to do:
Code:
function OpenClose(obj) {
var oMenu=document.getElementById("s"+obj.id);
oMenu.style.visibility=(oMenu.style.visibility=="hidden")? "visible" : "hidden";
}

<div id="menu1" onmouseover="OpenClose(this)" onmouseout="OpenClose(this)">menu
    <div id="smenu1" style="visibility:hidden;">
    <a href="#">menuItem1</a><br>
    <a href="#">menuItem2</a><br>
    </div>
</div>

Reply With Quote
  #3  
Old November 9th, 2003, 01:55 PM
geek-fx geek-fx is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Nov 2003
Posts: 3 geek-fx User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Send a message via AIM to geek-fx
Worked like a charm, kudos to you flatlander!

Reply With Quote
Reply

Viewing: Dev Shed ForumsWeb DesignCSS Help > CSS Menu (DIV and LINK conflict)


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 2 hosted by Hostway