Posted By

soxiam on 02/25/07


Tagged

javascript menu navigation jquery collapse slide


Versions (?)

Who likes this?

11 people have marked this snippet as a favorite

basicmagic
bartekk
vali29
stavelin
gAmUssA
martingoldszein
esquareda
chippper
alejandrosuch
colingardom
deepakbhogre


jquery collapsible sidebar menu


 / Published in: Other
 

  1. <?xml version="1.0" encoding="utf-8"?>
  2. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
  3. "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  4. <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-us">
  5. <head>
  6. <title>DL Demo</title>
  7. <script src="http://jquery.com/src/jquery.js"></script>
  8. <script>
  9. $(document).ready(function(){
  10. $("dd:not(:first)").hide();
  11. $("dt a").click(function(){
  12. $("dd:visible").slideUp("slow");
  13. $(this).parent().next().slideDown("slow");
  14. return false;
  15. });
  16. });
  17. </script>
  18. <style>
  19. body { font-family: Arial; font-size: 16px; }
  20. dl { width: 300px; }
  21. dl,dd { margin: 0; }
  22. dt { background: #F39; font-size: 18px; padding: 5px; margin: 2px; }
  23. dt a { color: #FFF; }
  24. dd a { color: #000; }
  25. ul { list-style: none; padding: 5px; }
  26. </style>
  27. </head>
  28.  
  29. <body>
  30. <dl>
  31. <dt><a href="/">jQuery</a></dt>
  32. <dd>
  33. <ul>
  34. <li><a href="/src/">Download</a></li>
  35. <li><a href="/docs/">Documentation</a></li>
  36. <li><a href="/blog/">Blog</a></li>
  37.  
  38. </ul>
  39. </dd>
  40. <dt><a href="/discuss/">Community</a></dt>
  41. <dd>
  42. <ul>
  43. <li><a href="/discuss/">Mailing List</a></li>
  44. <li><a href="/tutorials/">Tutorials</a></li>
  45.  
  46. <li><a href="/demos/">Demos</a></li>
  47. <li><a href="/plugins/">Plugins</a></li>
  48. </ul>
  49. </dd>
  50. <dt><a href="/dev/">Development</a></dt>
  51. <dd>
  52. <ul>
  53.  
  54. <li><a href="/src/">Source Code</a></li>
  55. <li><a href="/dev/bugs/">Bug Tracking</a></li>
  56. <li><a href="/dev/recent/">Recent Changes</a></li>
  57. </ul>
  58. </dd>
  59. </dl>
  60. </body>
  61. </html>
  62.  

Report this snippet  

You need to login to post a comment.