Reply
Parent hover active while pointing at subnav
Old 07-03-2009, 06:25 PM Parent hover active while pointing at subnav
Average Talker

Posts: 16
Name: Brian
Trades: 0
Hello all,
I've had some good luck setting up a nested css menu but am confused about one thing. When I hover over the subnavs (slideouts), the parent hover state goes back to non-active. How do I make the parent stay in the hover state while pointing at one of its subnavs? I think a:active has something to do with it but I haven't had much luck.

PS: this menu isn't wired for IE yet so don't worry about all the issue there.

Thanks for any help!
Brian

HTML Code:
<div id="left-menu">
<ul>
  <li>
    <ul>
      <li><a href="#" title="Encounter the People">Encounter the People</a>
        <ul>
          
            <li><a href="#" title="Native History &amp; Tradition">Native History &amp; Tradition</a>
                <ul>
                <li><a href="#" title="Navajo">Navajo</a></li>
                <li><a href="#" title="Hopi">Hopi</a></li>   
                </ul>
            </li>
          
            <li><a href="#" title="Artists Directory">Artists Directory</a></li>
        </ul>
      </li>
    </ul>
  </li>
</ul>
<ul>
  <li>
    <ul>
      <li><a href="#" title="Visual Gallery">Visual Gallery</a>
        <ul>
          
            <li><a href="#" title="Photo">Photo</a></li>
            <li><a href="#" title="Video">Video</a></li>
        </ul>
      </li>
    </ul>
  </li>
</ul>
<ul>
  <li>
    <ul>
      <li><a href="#" title="Go Beyond: Travel the Trails">Travel the Trails</a>
        <ul>
          
            <li><a href="#" title="Trail Maps">Trail Maps</a>
                
                <ul>
                    <li><a href="#" title="Interactive Map">Interactive Map</a></li>
                    <li><a href="#" title="Individual Trail Maps &amp; Itineraries">Trail Maps &amp; Itineraries</a></li>
                </ul>
   </li>
            
            <li><a href="#" title="Visitor Information">Visitor Information</a>
                <ul>
                    <li><a href="#" title="Regional Orientation">Regional Orientation</a></li>
                    <li><a href="#" title="Visitor FAQ">Visitor FAQ</a></li>
                </ul>
   </li>
        </ul>
      </li>
    </ul>
  </li>
</ul>
<ul>
  <li>
    <ul>
      <li><a href="#" title="News/Events">News/Events</a>
        <ul>
          
            <li><a href="#" title="Events Calendar">Events Calendar</a></li>
            <li><a href="#" title="News Info/Press Releases">News Info/Press Releases</a></li>
        </ul>
      </li>
    </ul>
  </li>
</ul>
<ul>
  <li>
    <ul>
      <li><a href="#" title="About NANACT">About NANACT</a>
        <ul>
        
            <li><a href="#" title="Background &amp; Purpose">Background &amp; Purpose</a></li>
            
            <li><a href="#" title="Call for Artists">Call for Artists</a></li>
          
            <li><a href="#" title="Artist Resources">Learn More</a>
                <ul>
                <li><a href="#" title="What is NANACT?">What is NANACT?</a></li>
                <li><a href="#" title="Who is Involved?">Who is Involved?</a></li>
                <li><a href="#" title="How NANACT Helps">How NANACT Helps</a></li>
                <li><a href="#" title="Why Apply?">Why Apply?</a></li> 
                <li><a href="#" title="How to Apply">How to Apply</a></li>    
                </ul>
            </li>
        </ul>
      </li>
    </ul>
  </li>
</ul>
     
</div>
        
        </div>
        <!--Left_Nav ended-->
 
Code:
 
#spacer {margin-top: 20px;}
#left-menu {
 width: 261px;
} 
#left-menu ul { /* remove bullets and list indents */
 list-style: none;
 margin: 0;
 padding: 0;
}
/* style, color and size links and headings to suit */
#left-menu a {
 display: block;
 margin: 0;
 font-weight: bold;
 font-family: "Trebuchet MS", Trebuchet, Verdana, Arial, Helvetica, sans-serif;
 color: #FFF0C7;
 text-decoration: none;
 height: 32px;
 padding-left: 30px;
 padding-top: 10px;
}
#left-menu a:hover {
 color: #b24800;
 background-image: url(../images/left_navigation/left_nav_over_state.jpg);
}
#left-menu li {
 /* make the list elements a containing block for the nested lists */
position: relative;
 padding-left: 0px;
 margin-left: 0px;
} 
#left-menu ul ul ul {
 position: absolute;
 top: 0;
 background:#fff1c6;
 border:solid;
 border-width: 2px;
 border-color:#857e5b;
 left: 100%; /* to position them to the right of their containing block */
 width: 100%; /* width is based on the containing block */
 color: #B1A678;
}
#left-menu ul ul ul a{
 background:#fff1c6;
 color: #B1A678;
}
#left-menu ul ul ul a:hover {
 background-image: url(none);
}
div#left-menu ul ul ul,
div#left-menu ul ul li:hover ul ul
{display: none;}
div#left-menu ul ul li:hover ul,
div#left-menu ul ul ul li:hover ul
{display: block;}
mistercheezit is offline
Reply With Quote
View Public Profile
 
 
When You Register, These Ads Go Away!
Old 07-04-2009, 11:03 AM Re: Parent hover active while pointing at subnav
Average Talker

Posts: 16
Name: Brian
Trades: 0
After some research it appears that I'm not the only one with this problem. Examples like http://htmldog.com/articles/suckerfi.../vertical.html don't keep the parent items highlighted either. So I'm assuming the solution will lie in javascript or some similar hack.

I did find this:

Code:
 
#nav li:hover > a:link,
#nav li:hover > a:visited  {
highlighted properties
}
But this made all of my elements use the same hover bg and it totally blows up in IE6. Aaaargh! I'm trying to get away from 100% js menus but this is proving aggravating, limits creativity and is eating up tons of time.

If anyone knows a way to make the parent elements to display their hover states while navigating sub elements, please let me know.

Brian
mistercheezit is offline
Reply With Quote
View Public Profile
 
Old 07-04-2009, 01:15 PM Re: Parent hover active while pointing at subnav
LadynRed's Avatar
Super Moderator

Posts: 8,823
Location: Tennessee
Trades: 0
Quote:
If anyone knows a way to make the parent elements to display their hover states while navigating sub elements, please let me know.
You can't, at least not in the way you want. You can, however, add a class to the parent menu that is the same as the rules for the hover state, but that would not keep the parent menu 'hovered' at the same time the sub-menu item is in it's hover state. The only way you're going to get that particular effect is with scripting.
__________________
Web Goddess & Web Standards Evangelist :) - Tables Be Gone !!
"Using or working with IE is like having to wear a 1970's polyester suit with pantyhose and a girdle, to work everyday"
Carolina Corvette Club
LadynRed is offline
Reply With Quote
View Public Profile
 
Old 07-04-2009, 02:55 PM Re: Parent hover active while pointing at subnav
Average Talker

Posts: 16
Name: Brian
Trades: 0
Okay, good to know. Think I'll just come up with a different nav solution since I'm no js person.
mistercheezit is offline
Reply With Quote
View Public Profile
 
Old 07-04-2009, 03:06 PM Re: Parent hover active while pointing at subnav
Junior Talker

Posts: 1
Name: Rajesh Kannan MJ
Location: Internet
Trades: 0
Try this one,

http://users.tpg.com.au/j_birch/plug...fish/#examples

It will work as you like,

it is little advanced suckerfish

Best Regards,

Vrajesh
vijayrajesh is offline
Reply With Quote
View Public Profile Visit vijayrajesh's homepage!
 
Old 07-04-2009, 03:51 PM Re: Parent hover active while pointing at subnav
Average Talker

Posts: 16
Name: Brian
Trades: 0
Wow, that's great. Thank you for posting the link, I'll attempt to implement this solution.
mistercheezit is offline
Reply With Quote
View Public Profile
 
Old 07-05-2009, 07:21 PM Re: Parent hover active while pointing at subnav
Average Talker

Posts: 16
Name: Brian
Trades: 0
It took some sweat but superfish came through. I'll post the website www.nanact.org at the end of this week if anybody cares to see the application of the menu. Thanks again.

Brian
mistercheezit is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to Parent hover active while pointing at subnav
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML

 



Page generated in 0.17129 seconds with 13 queries