How to not show the sprite onrollover in the submenu??

Discussion in 'CSS' started by 123GoToAndPlay, Feb 20, 2010.

  1. #1
    Hi,

    I am using a css sprite with a simple rollover state. But now the submenu show the onrollover image as well

    
     <li id="home">
                            <a href="#">Home</a>
                            <div id="home_drop" class="dropdown">
                                <div class="dropdown_internal" >
                                    <?= $dropdown?>
                                    <div class="clear"></div>
                                </div>
                            </div>							
                        </li>
                        <li id="jobs"><a href="#vacatures">Jobs</a>
                            <div id="jobs_drop" class="dropdown">
                                <div class="dropdown_internal" >
                                    <?= $dropdown?>
                                    <div class="clear"></div>
                                </div>
                            </div>		
                        </li>
    
    Code (markup):
    and part of my css
    
    #home a:hover {background:url("http://city2go.net/assets/imgs/mainmenu3.jpg") 0px -30px no-repeat; }
     #jobs a:hover {background:url("http://city2go.net/assets/imgs/mainmenu3.jpg") -123px -30px no-repeat; }
    
    Code (markup):
    is there a way to make sure the onrollover/background only works on the li and not on the li>ul>li's????


    Here's an example; bldd.nl/prototypes/megamenu/test23.php
     
    Last edited: Feb 20, 2010
    123GoToAndPlay, Feb 20, 2010 IP
  2. deathshadow

    deathshadow Acclaimed Member

    Messages:
    9,732
    Likes Received:
    1,999
    Best Answers:
    253
    Trophy Points:
    515
    #2
    unset the value on the nested ones.

    li ul a { background:none; }

    I'd have to see it running to be sure, but what are you doing with all those div? Seem kinda pointless. (especially the clearing div, what is this 1991?)

    But then I say the same thing about constantly opening/closing <? ?> in php. It's called echo, exists for a reason... and throwing javascript in for stome silly animation; But I'm a asshole in that department. When I am using a navigation I want to see it NOW, not two to five seconds from now after some goofy animated crap.

    Though if you are going to have that many links in the dropdowns, I'd say you're page navigation is overly complex and split into too many pages.

    Just part of why I consider anything jquery based to be a miserable steaming pile of /FAIL/.
     
    deathshadow, Feb 21, 2010 IP