Google Groups Home
Help | Sign in
Jquery Help - Navigation
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  2 messages - Collapse all
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
bludog  
View profile
 More options May 16, 4:40 pm
From: bludog <bludogwebstu...@gmail.com>
Date: Fri, 16 May 2008 13:40:38 -0700 (PDT)
Local: Fri, May 16 2008 4:40 pm
Subject: Jquery Help - Navigation
This is probably something very basic, but why does this logic only
work for the first section of ul's in the nav and not the next? Please
enlighten me. Thanks.

    <style type="text/css">
                body, body * {margin: 0px; padding: 0px;}
                ul#mainNav li{display: inline;}
                #nav{background: tan; width: 100%; font-size: .90em; text-align:
center;}
                ul#mainNav a { text-decoration: none;  padding-right: 6px; padding-
left: 6px; color: #fff;}
                ul#mainNav a:hover { background: #000; color: #fff; padding-top:
0px;}
                #subNav{background: #000 !important; color: #fff; float: left;
clear: left;}
                #mainNav li ul {display: none;}
                #subNav ul li a:hover{color: #000; background: #fff !important;}
                #mainContent {clear: both;}
        </style>
<script src="../../js/jquery.js" type="text/javascript"></script>
<script type="text/javascript">

$(document).ready(function() {
        $("#subNav").each(function(){
                $(this).mouseover(function(){
                         $(this).next('ul').show();
                });
        $(this).mouseout(function(){
                         $(this).next('ul').hide();
                });
        });

});

</script>
  </head>

  <body>
  <div id="nav">
  <ul  id="mainNav">
        <li><a id="subNav" href="">About</a>
                <ul>
                        <li><a href="">The Story</a></li>
                        <Li><a href="">FAQ</a></LI>
                        <li><a href="">Designs and DSA</a></li>
                        <li><a href="">Mission</a></li>
                        <li><a href="">OTC</a></li>
                        <li><a href="">POJD</a></li>
                        <li><a href="">B&amp;T</a></li>
                        <li><a href="">10 Yr Anniv.</a></li>
                </ul>
        </li>
        <li><a id="subNav" href="">About</a>
                <ul>
                        <li><a href="">The Story</a></li>
                        <Li><a href="">FAQ</a></LI>
                        <li><a href="">Designs and DSA</a></li>
                        <li><a href="">Mission</a></li>
                        <li><a href="">OTC</a></li>
                        <li><a href="">POJD</a></li>
                        <li><a href="">B&amp;T</a></li>
                        <li><a href="">10 Yr Anniv.</a></li>
                </ul>
        </li>
</ul>
</div>


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Karl Swedberg  
View profile
 More options May 16, 5:15 pm
From: Karl Swedberg <k...@englishrules.com>
Date: Fri, 16 May 2008 17:15:04 -0400
Local: Fri, May 16 2008 5:15 pm
Subject: Re: [jQuery] Jquery Help - Navigation

On May 16, 2008, at 4:40 PM, bludog wrote:

> This is probably something very basic, but why does this logic only
> work for the first section of ul's in the nav and not the next? Please
> enlighten me. Thanks.

You're using multiple elements with the same ID, which is not valid.  
Instead of using an ID, use a class (and change your selector to match).

Also, I'd recommend using .hover(fn, fn) rather than .mouseover()  
and .mouseout()

--Karl
_________________
Karl Swedberg
www.englishrules.com
www.learningjquery.com

On May 16, 2008, at 4:40 PM, bludog wrote:


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »

Create a group - Google Groups - Google Home - Terms of Service - Privacy Policy
©2008 Google