What you're not being able to accomplish is a side effect of your
addition of accordion style navigation.
$("dt a").click( function () {
$("dd:visible").slideUp("slow");
$(this).parent().next().slideDown("slow");
return false;
});
You've prevented the default click action on that anchor tag by
returning false, basically overriding the link-handling mechanism with
an accordion-handling mechanism. You're going to have to choose either-
or in this case if you want the accordion action applied to the dt
link. You can however add an additional element (plus-sign, let's say)
that the accordion-handling could be attached to, or you could change
the accordion to be handled on hover. You may also want to look into
jQuery UI for a very well-tested cross-browser accordion plugin.
Hope this helps.
Nathan Hammond
PS: This list is for development of jQuery itself. Questions about
development with jQuery are best sent to
http://groups.google.com/group/jquery-en/
On Sep 15, 12:14 pm, "[EMAIL PROTECTED]"
<[EMAIL PROTECTED]> wrote:
> How does one create web links to the parent in addition to the
> children links? The following code only allows web links to the
> children. Thank you.
> <head>
> <title>DL Demo</title>
> <script src="http://jquery.com/src/jquery.js"></script>
> <script>
> $(document).ready(function(){
> $("dd:not(:first)").hide();
> $("dt a").click(function(){
> $("dd:visible").slideUp("slow");
> $(this).parent().next().slideDown("slow");
> return false;
> });
> });
> </script>
> <style>
> body { font-family: Arial; font-size: 16px; }
> dl { width: 300px; }
> dl,dd { margin: 0; }
> dt { background: #F39; font-size: 18px; padding: 5px; margin: 2px; }
> dt a { color: #FFF; }
> dd a { color: #000; }
> ul { list-style: none; padding: 5px; }
> </style>
> </head>
> <body>
> <dl>
> <dt><a href="/">jQuery</a></dt>
> <dd>
> <ul>
> <li><a href="/src/">Download</a></li>
> <li><a href="/docs/">Documentation</a></li>
> <li><a href="/blog/">Blog</a></li>
> </ul>
> </dd>
> <dt><a href="/discuss/">Community</a></dt>
> <dd>
> <ul>
> <li><a href="/discuss/">Mailing List</a></li>
> <li><a href="/tutorials/">Tutorials</a></li>
> <li><a href="/demos/">Demos</a></li>
> <li><a href="/plugins/">Plugins</a></li>
> </ul>
> </dd>
> <dt><a href="/dev/">Development</a></dt>
> <dd>
> <ul>
> <li><a href="/src/">Source Code</a></li>
> <li><a href="/dev/bugs/">Bug Tracking</a></li>
> <li><a href="/dev/recent/">Recent Changes</a></li>
> </ul>
> </dd>
> </dl>
> </body>
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"jQuery Development" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/jquery-dev?hl=en
-~----------~----~----~----~------~----~------~--~---