Advertisement
Guest User

Untitled

a guest
Nov 27th, 2015
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.91 KB | None | 0 0
  1. <html>
  2.  
  3. <head>
  4. <title>jQuery</title>
  5. <meta charset="utf-8">
  6. <script type="text/javascript" src="jquery.js"></script>
  7. <script type="text/javascript">
  8. $(document).ready(function() {
  9. $(".contenu_point").hide();
  10. $("hr").hide();
  11. $(".contenu_chapitre").hide();
  12.  
  13. $("div.menu_point").hide();
  14. $("p.menu_chapitre").click(function() {
  15. $(this).next("div.menu_point").slideDown(300)
  16. .siblings("div.menu_point").slideUp("slow");
  17. });
  18.  
  19. $("p").click(function() {
  20. $(".contenu_chapitre").html($(this).text());
  21. $(".contenu_chapitre").show();
  22.  
  23. });
  24. $("a").click(function() {
  25. $(".contenu_point").html($(this).text());
  26. $(".contenu_point").show();
  27. $("hr").show();
  28. });
  29. });
  30. </script>
  31. <style type="text/css">
  32. body {
  33. margin: 10px;
  34. font: 0.8em Arial, Helvetica, sans-serif;
  35. }
  36.  
  37. .menu {
  38. width: 150px;
  39. float: left;
  40. }
  41.  
  42. .menu_chapitre {
  43. padding: 5px;
  44. cursor: pointer;
  45. position: relative;
  46. margin: 1px;
  47. font-weight: bold;
  48. background: #9cf;
  49. border: 1px solid black;
  50. }
  51.  
  52. .menu_point a {
  53. display: block;
  54. color: black;
  55. background-color: white;
  56. padding-left: 30px;
  57. text-decoration: none;
  58. }
  59.  
  60. .menu_point a:hover {
  61. color: black;
  62. text-decoration: underline;
  63. }
  64.  
  65. .contenu {
  66. margin-left: 170px;
  67. padding: 5px;
  68. width: 200px;
  69. height: 200px;
  70. font-weight: bold;
  71. background: #9cf;
  72. border: 1px solid black;
  73. text-align: center;
  74. }
  75. </style>
  76. </head>
  77.  
  78. <body>
  79. <div class="menu">
  80. <p class="menu_chapitre">Chapitre 1</p>
  81. <div class="menu_point">
  82. <a href="#">Point 1</a>
  83. <a href="#">Point 2</a>
  84. <a href="#">Point 3</a>
  85. </div>
  86. <p class="menu_chapitre">Chapitre 2</p>
  87. <div class="menu_point">
  88. <a href="#">Point 1</a>
  89. <a href="#">Point 2</a>
  90. <a href="#">Point 3</a>
  91. </div>
  92. <p class="menu_chapitre">Chapitre 3</p>
  93. <div class="menu_point">
  94. <a href="#">Point 1</a>
  95. <a href="#">Point 2</a>
  96. <a href="#">Point 3</a>
  97. <a href="#">Point 4</a>
  98. </div>
  99. </div>
  100.  
  101. <div class="contenu">
  102. <p class="contenu_chapitre">Chapitre 1</p>
  103. <hr>
  104. <p class="contenu_point">Point 1</p>
  105. </div>
  106. </body>
  107.  
  108. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement