html/css/js question(S)

    Diese Seite verwendet Cookies. Durch die Nutzung unserer Seite erklären Sie sich damit einverstanden, dass wir Cookies setzen. Weitere Informationen

    • html/css/js question(S)

      moin.
      ich lern seit ca ner woche jetzt html und css weil ich eine webpage für eine entwicklungshilfe organisation einer freundin baun soll.

      ich arbeite mit dreamweaver und bisher konnte ich alle hürden überwinden aber ich würde auf einer seite gerne "spry tabbed panels" (mit scrollbar) verwenden und hab das problem, dass die scrollbar beim wechseln der tabs nicht resettet, man also irgendwo startet wenn man von einem tab in dem man gescrollt hat in ein anderes wechselt.
      ich fürchte mal das wird sich nicht per css lösen lassen und hab echt keine ahnung von js bzw keine zeit das dafür zu lernen...

      hatte schonmal wer das problem bzw gäbs ne "einfache" lösung?
      google half nicht weiter :/
      Spoiler anzeigen

      html:

      Quellcode

      1. <div id="TabbedPanels1" class="VTabbedPanels">
      2. <ul class="TabbedPanelsTabGroup">
      3. <li class="TabbedPanelsTab" tabindex="0">Invidun Tour</li>
      4. <li class="TabbedPanelsTab" tabindex="0">Elitr Tour</li>
      5. <li class="TabbedPanelsTab" tabindex="0">Ipsum Tour</li>
      6. <li class="TabbedPanelsTab" tabindex="0">Labore Tour</li>
      7. </ul>
      8. <div class="TabbedPanelsContentGroup">
      9. <div class="TabbedPanelsContent">Invidun Tour<img src="bilder/sa-bild.jpg" alt="südafrika ist nicht kenya" name="bild" width="320" height="240" id="bild" /><br /><br />
      10. <p>Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumyLorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua.</p>
      11. <p>Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. <br />
      12. </p>
      13. <p>Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. </p> <p>Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. </p>
      14. <p>Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua.
      15. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua.
      16. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. </p>
      17. <p>Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. </p>
      18. </div>
      19. <div class="TabbedPanelsContent">Content 3<br />
      20. <p>Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy<p>
      21. <p>Lorem ipsum dolor </p>
      22. <iframe width="420" height="345" src="http://www.youtube.com/embed/obtGsVcrE00" frameborder="0" allowfullscreen></iframe>
      23. <p>Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. <br />
      24. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. <br />
      25. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy </p>
      26. <p>Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua.
      27. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua.
      28. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. </p>
      29. <p>Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. </p>
      30. <p>Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. </p>
      31. </div>
      32. <div class="TabbedPanelsContent">Content 4<br />
      33. <p>Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. <br />
      34. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy </p>
      35. <p>Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua.
      36. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua.
      37. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. </p>
      38. </div>
      39. <div class="TabbedPanelsContent">Content 2<br />
      40. <p>Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. </p> <p>Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua.
      41. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua.
      42. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. </p> <p>Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua.
      43. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua.
      44. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. </p>
      45. <p>Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. </p>
      46. <p>Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. </p>
      47. <p>Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. </p>
      48. <p>Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. </p>
      49. </div>
      50. </div>
      51. </div>
      52. <script type="text/javascript">
      53. var TabbedPanels1 = new Spry.Widget.TabbedPanels("TabbedPanels1");
      54. </script>
      Alles anzeigen


      css:

      Quellcode

      1. @charset "UTF-8";
      2. /* SpryTabbedPanels.css - version 0.6 - Spry Pre-Release 1.6.1 */
      3. /* Copyright (c) 2006. Adobe Systems Incorporated. All rights reserved. */
      4. /* Horizontal Tabbed Panels
      5. *
      6. * The default style for a TabbedPanels widget places all tab buttons
      7. * (left aligned) above the content panel.
      8. */
      9. /* This is the selector for the main TabbedPanels container. For our
      10. * default style, this container does not contribute anything visually,
      11. * but it is floated left to make sure that any floating or clearing done
      12. * with any of its child elements are contained completely within the
      13. * TabbedPanels container, to minimize any impact or undesireable
      14. * interaction with other floated elements on the page that may be used
      15. * for layout.
      16. *
      17. * If you want to constrain the width of the TabbedPanels widget, set a
      18. * width on the TabbedPanels container. By default, the TabbedPanels widget
      19. * expands horizontally to fill up available space.
      20. *
      21. * The name of the class ("TabbedPanels") used in this selector is not
      22. * necessary to make the widget function. You can use any class name you
      23. * want to style the TabbedPanels container.
      24. */
      25. .TabbedPanels {
      26. overflow: hidden;
      27. margin: 0px;
      28. padding: 0px;
      29. clear: none;
      30. width: 100%;
      31. }
      32. /* This is the selector for the TabGroup. The TabGroup container houses
      33. * all of the tab buttons for each tabbed panel in the widget. This container
      34. * does not contribute anything visually to the look of the widget for our
      35. * default style.
      36. *
      37. * The name of the class ("TabbedPanelsTabGroup") used in this selector is not
      38. * necessary to make the widget function. You can use any class name you
      39. * want to style the TabGroup container.
      40. */
      41. .TabbedPanelsTabGroup {
      42. margin: 0px;
      43. padding: 0px;
      44. }
      45. /* This is the selector for the TabbedPanelsTab. This container houses
      46. * the title for the panel. This is also the tab "button" that the user clicks
      47. * on to activate the corresponding content panel so that it appears on top
      48. * of the other tabbed panels contained in the widget.
      49. *
      50. * For our default style, each tab is positioned relatively 1 pixel down from
      51. * where it wold normally render. This allows each tab to overlap the content
      52. * panel that renders below it. Each tab is rendered with a 1 pixel bottom
      53. * border that has a color that matches the top border of the current content
      54. * panel. This gives the appearance that the tab is being drawn behind the
      55. * content panel.
      56. *
      57. * The name of the class ("TabbedPanelsTab") used in this selector is not
      58. * necessary to make the widget function. You can use any class name you want
      59. * to style this tab container.
      60. */
      61. .TabbedPanelsTab {
      62. position: relative;
      63. top: 1px;
      64. float: left;
      65. padding: 4px 10px;
      66. /*margin: 0px 1px 0px 0px;*/
      67. font: bold 0.7em sans-serif;
      68. list-style: none;
      69. /*-moz-user-select: none;
      70. -khtml-user-select: none;*/
      71. cursor: pointer;
      72. }
      73. /* This selector is an example of how to change the appearnce of a tab button
      74. * container as the mouse enters it. The class "TabbedPanelsTabHover" is
      75. * programatically added and removed from the tab element as the mouse enters
      76. * and exits the container.
      77. */
      78. .TabbedPanelsTabHover {
      79. background-color: #FFF;
      80. }
      81. /* This selector is an example of how to change the appearance of a tab button
      82. * container after the user has clicked on it to activate a content panel.
      83. * The class "TabbedPanelsTabSelected" is programatically added and removed
      84. * from the tab element as the user clicks on the tab button containers in
      85. * the widget.
      86. *
      87. * As mentioned above, for our default style, tab buttons are positioned
      88. * 1 pixel down from where it would normally render. When the tab button is
      89. * selected, we change its bottom border to match the background color of the
      90. * content panel so that it looks like the tab is part of the content panel.
      91. */
      92. .TabbedPanelsTabSelected {
      93. }
      94. /* This selector is an example of how to make a link inside of a tab button
      95. * look like normal text. Users may want to use links inside of a tab button
      96. * so that when it gets focus, the text *inside* the tab button gets a focus
      97. * ring around it, instead of the focus ring around the entire tab.
      98. */
      99. .TabbedPanelsTab a {
      100. color: black;
      101. text-decoration: none;
      102. }
      103. /* This is the selector for the ContentGroup. The ContentGroup container houses
      104. * all of the content panels for each tabbed panel in the widget. For our
      105. * default style, this container provides the background color and borders that
      106. * surround the content.
      107. *
      108. * The name of the class ("TabbedPanelsContentGroup") used in this selector is
      109. * not necessary to make the widget function. You can use any class name you
      110. * want to style the ContentGroup container.
      111. */
      112. .TabbedPanelsContentGroup {
      113. clear: both;
      114. }
      115. /* This is the selector for the Content panel. The Content panel holds the
      116. * content for a single tabbed panel. For our default style, this container
      117. * provides some padding, so that the content is not pushed up against the
      118. * widget borders.
      119. *
      120. * The name of the class ("TabbedPanelsContent") used in this selector is
      121. * not necessary to make the widget function. You can use any class name you
      122. * want to style the Content container.
      123. */
      124. .TabbedPanelsContent {
      125. overflow: hidden;
      126. background-color: #FFF;
      127. padding-top: 5px;
      128. padding-right: 5px;
      129. padding-bottom: 5px;
      130. padding-left: 10px;
      131. }
      132. /* This selector is an example of how to change the appearnce of the currently
      133. * active container panel. The class "TabbedPanelsContentVisible" is
      134. * programatically added and removed from the content element as the panel
      135. * is activated/deactivated.
      136. */
      137. .TabbedPanelsContentVisible {
      138. }
      139. /* Vertical Tabbed Panels
      140. *
      141. * The following rules override some of the default rules above so that the
      142. * TabbedPanels widget renders with its tab buttons along the left side of
      143. * the currently active content panel.
      144. *
      145. * With the rules defined below, the only change that will have to be made
      146. * to switch a horizontal tabbed panels widget to a vertical tabbed panels
      147. * widget, is to use the "VTabbedPanels" class on the top-level widget
      148. * container element, instead of "TabbedPanels".
      149. */
      150. .VTabbedPanels {
      151. overflow: hidden;
      152. /*zoom: 1;???!!!*/
      153. background-color: #FFF;
      154. }
      155. /* This selector floats the TabGroup so that the tab buttons it contains
      156. * render to the left of the active content panel. A border is drawn around
      157. * the group container to make it look like a list container.
      158. */
      159. .VTabbedPanels .TabbedPanelsTabGroup {
      160. float: left;
      161. width: 8em;
      162. height: 10em;
      163. background-color: #FFF;
      164. position: relative;
      165. padding-top: 5px;
      166. }
      167. /* This selector disables the float property that is placed on each tab button
      168. * by the default TabbedPanelsTab selector rule above. It also draws a bottom
      169. * border for the tab. The tab button will get its left and right border from
      170. * the TabGroup, and its top border from the TabGroup or tab button above it.
      171. */
      172. .VTabbedPanels .TabbedPanelsTab {
      173. float: none;
      174. background-color: #CCC;
      175. margin-bottom: 3px;
      176. margin-left: 3px;
      177. line-height: 25px;
      178. font-size: 15px;
      179. border-top-width: 1px;
      180. border-right-width: 1px;
      181. border-bottom-width: 1px;
      182. border-left-width: 1px;
      183. border-top-style: solid;
      184. border-right-style: none;
      185. border-bottom-style: solid;
      186. border-left-style: solid;
      187. border-top-color: #000;
      188. border-right-color: #000;
      189. border-bottom-color: #000;
      190. border-left-color: #000;
      191. }
      192. /* This selector disables the float property that is placed on each tab button
      193. * by the default TabbedPanelsTab selector rule above. It also draws a bottom
      194. * border for the tab. The tab button will get its left and right border from
      195. * the TabGroup, and its top border from the TabGroup or tab button above it.
      196. */
      197. .VTabbedPanels .TabbedPanelsTabSelected {
      198. background-color: #FFF;
      199. border-right-style: none;
      200. }
      201. /* This selector floats the content panels for the widget so that they
      202. * render to the right of the tabbed buttons.
      203. */
      204. .VTabbedPanels .TabbedPanelsContentGroup {
      205. clear: none;/*right;*/
      206. float: left;
      207. background-color: #FFF;
      208. padding-top: 5px;
      209. width: 81%;
      210. border: 1px solid #000;
      211. overflow-y:scroll;
      212. height:33em;
      213. }
      214. /* Styles for Printing */
      215. @media print {
      216. .TabbedPanels {
      217. overflow: visible !important;
      218. }
      219. .TabbedPanelsContentGroup {
      220. display: block !important;
      221. overflow: visible !important;
      222. height: auto !important;
      223. color: #D6D6D6;
      224. }
      225. .TabbedPanelsContent {
      226. overflow: visible !important;
      227. display: block !important;
      228. clear:both !important;
      229. }
      230. .TabbedPanelsTab {
      231. overflow: visible !important;
      232. display: block !important;
      233. clear:both !important;
      234. }
      235. }
      Alles anzeigen


      js:

      Quellcode

      1. // SpryTabbedPanels.js - version 0.7 - Spry Pre-Release 1.6.1
      2. //
      3. // Copyright (c) 2006. Adobe Systems Incorporated.
      4. // All rights reserved.
      5. //
      6. // Redistribution and use in source and binary forms, with or without
      7. // modification, are permitted provided that the following conditions are met:
      8. //
      9. // * Redistributions of source code must retain the above copyright notice,
      10. // this list of conditions and the following disclaimer.
      11. // * Redistributions in binary form must reproduce the above copyright notice,
      12. // this list of conditions and the following disclaimer in the documentation
      13. // and/or other materials provided with the distribution.
      14. // * Neither the name of Adobe Systems Incorporated nor the names of its
      15. // contributors may be used to endorse or promote products derived from this
      16. // software without specific prior written permission.
      17. //
      18. // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
      19. // AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
      20. // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
      21. // ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
      22. // LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
      23. // CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
      24. // SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
      25. // INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
      26. // CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
      27. // ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
      28. // POSSIBILITY OF SUCH DAMAGE.
      29. (function() { // BeginSpryComponent
      30. if (typeof Spry == "undefined") window.Spry = {}; if (!Spry.Widget) Spry.Widget = {};
      31. Spry.Widget.TabbedPanels = function(element, opts)
      32. {
      33. this.element = this.getElement(element);
      34. this.defaultTab = 0; // Show the first panel by default.
      35. this.tabSelectedClass = "TabbedPanelsTabSelected";
      36. this.tabHoverClass = "TabbedPanelsTabHover";
      37. this.tabFocusedClass = "TabbedPanelsTabFocused";
      38. this.panelVisibleClass = "TabbedPanelsContentVisible";
      39. this.focusElement = null;
      40. this.hasFocus = false;
      41. this.currentTabIndex = 0;
      42. this.enableKeyboardNavigation = true;
      43. this.nextPanelKeyCode = Spry.Widget.TabbedPanels.KEY_RIGHT;
      44. this.previousPanelKeyCode = Spry.Widget.TabbedPanels.KEY_LEFT;
      45. Spry.Widget.TabbedPanels.setOptions(this, opts);
      46. // If the defaultTab is expressed as a number/index, convert
      47. // it to an element.
      48. if (typeof (this.defaultTab) == "number")
      49. {
      50. if (this.defaultTab < 0)
      51. this.defaultTab = 0;
      52. else
      53. {
      54. var count = this.getTabbedPanelCount();
      55. if (this.defaultTab >= count)
      56. this.defaultTab = (count > 1) ? (count - 1) : 0;
      57. }
      58. this.defaultTab = this.getTabs()[this.defaultTab];
      59. }
      60. // The defaultTab property is supposed to be the tab element for the tab content
      61. // to show by default. The caller is allowed to pass in the element itself or the
      62. // element's id, so we need to convert the current value to an element if necessary.
      63. if (this.defaultTab)
      64. this.defaultTab = this.getElement(this.defaultTab);
      65. this.attachBehaviors();
      66. };
      67. Spry.Widget.TabbedPanels.prototype.getElement = function(ele)
      68. {
      69. if (ele && typeof ele == "string")
      70. return document.getElementById(ele);
      71. return ele;
      72. };
      73. Spry.Widget.TabbedPanels.prototype.getElementChildren = function(element)
      74. {
      75. var children = [];
      76. var child = element.firstChild;
      77. while (child)
      78. {
      79. if (child.nodeType == 1 /* Node.ELEMENT_NODE */)
      80. children.push(child);
      81. child = child.nextSibling;
      82. }
      83. return children;
      84. };
      85. Spry.Widget.TabbedPanels.prototype.addClassName = function(ele, className)
      86. {
      87. if (!ele || !className || (ele.className && ele.className.search(new RegExp("\\b" + className + "\\b")) != -1))
      88. return;
      89. ele.className += (ele.className ? " " : "") + className;
      90. };
      91. Spry.Widget.TabbedPanels.prototype.removeClassName = function(ele, className)
      92. {
      93. if (!ele || !className || (ele.className && ele.className.search(new RegExp("\\b" + className + "\\b")) == -1))
      94. return;
      95. ele.className = ele.className.replace(new RegExp("\\s*\\b" + className + "\\b", "g"), "");
      96. };
      97. Spry.Widget.TabbedPanels.setOptions = function(obj, optionsObj, ignoreUndefinedProps)
      98. {
      99. if (!optionsObj)
      100. return;
      101. for (var optionName in optionsObj)
      102. {
      103. if (ignoreUndefinedProps && optionsObj[optionName] == undefined)
      104. continue;
      105. obj[optionName] = optionsObj[optionName];
      106. }
      107. };
      108. Spry.Widget.TabbedPanels.prototype.getTabGroup = function()
      109. {
      110. if (this.element)
      111. {
      112. var children = this.getElementChildren(this.element);
      113. if (children.length)
      114. return children[0];
      115. }
      116. return null;
      117. };
      118. Spry.Widget.TabbedPanels.prototype.getTabs = function()
      119. {
      120. var tabs = [];
      121. var tg = this.getTabGroup();
      122. if (tg)
      123. tabs = this.getElementChildren(tg);
      124. return tabs;
      125. };
      126. Spry.Widget.TabbedPanels.prototype.getContentPanelGroup = function()
      127. {
      128. if (this.element)
      129. {
      130. var children = this.getElementChildren(this.element);
      131. if (children.length > 1)
      132. return children[1];
      133. }
      134. return null;
      135. };
      136. Spry.Widget.TabbedPanels.prototype.getContentPanels = function()
      137. {
      138. var panels = [];
      139. var pg = this.getContentPanelGroup();
      140. if (pg)
      141. panels = this.getElementChildren(pg);
      142. return panels;
      143. };
      144. Spry.Widget.TabbedPanels.prototype.getIndex = function(ele, arr)
      145. {
      146. ele = this.getElement(ele);
      147. if (ele && arr && arr.length)
      148. {
      149. for (var i = 0; i < arr.length; i++)
      150. {
      151. if (ele == arr[i])
      152. return i;
      153. }
      154. }
      155. return -1;
      156. };
      157. Spry.Widget.TabbedPanels.prototype.getTabIndex = function(ele)
      158. {
      159. var i = this.getIndex(ele, this.getTabs());
      160. if (i < 0)
      161. i = this.getIndex(ele, this.getContentPanels());
      162. return i;
      163. };
      164. Spry.Widget.TabbedPanels.prototype.getCurrentTabIndex = function()
      165. {
      166. return this.currentTabIndex;
      167. };
      168. Spry.Widget.TabbedPanels.prototype.getTabbedPanelCount = function(ele)
      169. {
      170. return Math.min(this.getTabs().length, this.getContentPanels().length);
      171. };
      172. Spry.Widget.TabbedPanels.addEventListener = function(element, eventType, handler, capture)
      173. {
      174. try
      175. {
      176. if (element.addEventListener)
      177. element.addEventListener(eventType, handler, capture);
      178. else if (element.attachEvent)
      179. element.attachEvent("on" + eventType, handler);
      180. }
      181. catch (e) {}
      182. };
      183. Spry.Widget.TabbedPanels.prototype.cancelEvent = function(e)
      184. {
      185. if (e.preventDefault) e.preventDefault();
      186. else e.returnValue = false;
      187. if (e.stopPropagation) e.stopPropagation();
      188. else e.cancelBubble = true;
      189. return false;
      190. };
      191. Spry.Widget.TabbedPanels.prototype.onTabClick = function(e, tab)
      192. {
      193. this.showPanel(tab);
      194. return this.cancelEvent(e);
      195. };
      196. Spry.Widget.TabbedPanels.prototype.onTabMouseOver = function(e, tab)
      197. {
      198. this.addClassName(tab, this.tabHoverClass);
      199. return false;
      200. };
      201. Spry.Widget.TabbedPanels.prototype.onTabMouseOut = function(e, tab)
      202. {
      203. this.removeClassName(tab, this.tabHoverClass);
      204. return false;
      205. };
      206. Spry.Widget.TabbedPanels.prototype.onTabFocus = function(e, tab)
      207. {
      208. this.hasFocus = true;
      209. this.addClassName(tab, this.tabFocusedClass);
      210. return false;
      211. };
      212. Spry.Widget.TabbedPanels.prototype.onTabBlur = function(e, tab)
      213. {
      214. this.hasFocus = false;
      215. this.removeClassName(tab, this.tabFocusedClass);
      216. return false;
      217. };
      218. Spry.Widget.TabbedPanels.KEY_UP = 38;
      219. Spry.Widget.TabbedPanels.KEY_DOWN = 40;
      220. Spry.Widget.TabbedPanels.KEY_LEFT = 37;
      221. Spry.Widget.TabbedPanels.KEY_RIGHT = 39;
      222. Spry.Widget.TabbedPanels.prototype.onTabKeyDown = function(e, tab)
      223. {
      224. var key = e.keyCode;
      225. if (!this.hasFocus || (key != this.previousPanelKeyCode && key != this.nextPanelKeyCode))
      226. return true;
      227. var tabs = this.getTabs();
      228. for (var i =0; i < tabs.length; i++)
      229. if (tabs[i] == tab)
      230. {
      231. var el = false;
      232. if (key == this.previousPanelKeyCode && i > 0)
      233. el = tabs[i-1];
      234. else if (key == this.nextPanelKeyCode && i < tabs.length-1)
      235. el = tabs[i+1];
      236. if (el)
      237. {
      238. this.showPanel(el);
      239. el.focus();
      240. break;
      241. }
      242. }
      243. return this.cancelEvent(e);
      244. };
      245. Spry.Widget.TabbedPanels.prototype.preorderTraversal = function(root, func)
      246. {
      247. var stopTraversal = false;
      248. if (root)
      249. {
      250. stopTraversal = func(root);
      251. if (root.hasChildNodes())
      252. {
      253. var child = root.firstChild;
      254. while (!stopTraversal && child)
      255. {
      256. stopTraversal = this.preorderTraversal(child, func);
      257. try { child = child.nextSibling; } catch (e) { child = null; }
      258. }
      259. }
      260. }
      261. return stopTraversal;
      262. };
      263. Spry.Widget.TabbedPanels.prototype.addPanelEventListeners = function(tab, panel)
      264. {
      265. var self = this;
      266. Spry.Widget.TabbedPanels.addEventListener(tab, "click", function(e) { return self.onTabClick(e, tab); }, false);
      267. Spry.Widget.TabbedPanels.addEventListener(tab, "mouseover", function(e) { return self.onTabMouseOver(e, tab); }, false);
      268. Spry.Widget.TabbedPanels.addEventListener(tab, "mouseout", function(e) { return self.onTabMouseOut(e, tab); }, false);
      269. if (this.enableKeyboardNavigation)
      270. {
      271. // XXX: IE doesn't allow the setting of tabindex dynamically. This means we can't
      272. // rely on adding the tabindex attribute if it is missing to enable keyboard navigation
      273. // by default.
      274. // Find the first element within the tab container that has a tabindex or the first
      275. // anchor tag.
      276. var tabIndexEle = null;
      277. var tabAnchorEle = null;
      278. this.preorderTraversal(tab, function(node) {
      279. if (node.nodeType == 1 /* NODE.ELEMENT_NODE */)
      280. {
      281. var tabIndexAttr = tab.attributes.getNamedItem("tabindex");
      282. if (tabIndexAttr)
      283. {
      284. tabIndexEle = node;
      285. return true;
      286. }
      287. if (!tabAnchorEle && node.nodeName.toLowerCase() == "a")
      288. tabAnchorEle = node;
      289. }
      290. return false;
      291. });
      292. if (tabIndexEle)
      293. this.focusElement = tabIndexEle;
      294. else if (tabAnchorEle)
      295. this.focusElement = tabAnchorEle;
      296. if (this.focusElement)
      297. {
      298. Spry.Widget.TabbedPanels.addEventListener(this.focusElement, "focus", function(e) { return self.onTabFocus(e, tab); }, false);
      299. Spry.Widget.TabbedPanels.addEventListener(this.focusElement, "blur", function(e) { return self.onTabBlur(e, tab); }, false);
      300. Spry.Widget.TabbedPanels.addEventListener(this.focusElement, "keydown", function(e) { return self.onTabKeyDown(e, tab); }, false);
      301. }
      302. }
      303. };
      304. Spry.Widget.TabbedPanels.prototype.showPanel = function(elementOrIndex)
      305. {
      306. var tpIndex = -1;
      307. if (typeof elementOrIndex == "number")
      308. tpIndex = elementOrIndex;
      309. else // Must be the element for the tab or content panel.
      310. tpIndex = this.getTabIndex(elementOrIndex);
      311. if (!tpIndex < 0 || tpIndex >= this.getTabbedPanelCount())
      312. return;
      313. var tabs = this.getTabs();
      314. var panels = this.getContentPanels();
      315. var numTabbedPanels = Math.max(tabs.length, panels.length);
      316. for (var i = 0; i < numTabbedPanels; i++)
      317. {
      318. if (i != tpIndex)
      319. {
      320. if (tabs[i])
      321. this.removeClassName(tabs[i], this.tabSelectedClass);
      322. if (panels[i])
      323. {
      324. this.removeClassName(panels[i], this.panelVisibleClass);
      325. panels[i].style.display = "none";
      326. }
      327. }
      328. }
      329. this.addClassName(tabs[tpIndex], this.tabSelectedClass);
      330. this.addClassName(panels[tpIndex], this.panelVisibleClass);
      331. panels[tpIndex].style.display = "block";
      332. this.currentTabIndex = tpIndex;
      333. };
      334. Spry.Widget.TabbedPanels.prototype.attachBehaviors = function(element)
      335. {
      336. var tabs = this.getTabs();
      337. var panels = this.getContentPanels();
      338. var panelCount = this.getTabbedPanelCount();
      339. for (var i = 0; i < panelCount; i++)
      340. this.addPanelEventListeners(tabs[i], panels[i]);
      341. this.showPanel(this.defaultTab);
      342. };
      343. })(); // EndSpryComponent
      Alles anzeigen

      Dieser Beitrag wurde bereits 1 mal editiert, zuletzt von q-ruf ()

    • Javascript ist dein Retter

      Hi,

      also ich lasse jetzt mal alle Kommentare zu deinem verwendeten JS und CSS und generell und überhaupt.

      Hier das was du brauchst:

      gib der Div mit dem Inhalt eine ID, etwa so:

      <div class="TabbedPanelsContentGroup" id="scroller">

      Öffne jetzt das Javascript file, gehe zur Zeile 384, du findet dies hier:

      this.addClassName(tabs[tpIndex], this.tabSelectedClass);
      this.addClassName(panels[tpIndex], this.panelVisibleClass);
      panels[tpIndex].style.display = "block";


      Füge folgenden Text untendrunter hinzu:
      document.getElementById("scroller").scrollTop=0;

      Et voila :) scrollt immer schön nach oben.

      Rechnung kommt!
      Return of the Ape
    • ich nutze diesen thread einfach mal.
      folgendes:
      Ich stelle mich grade UNGLAUBLICH blöd an und finde eifnach nichts bei google, weil ich halt den TAG dafür nicht weiß:

      ich will die homepage in einzelne "spalten" einteilen, sodass ich links ne spalte mit links habe und rechts daneben den eigentlichen inhalt, mit <blablabla target="main">" und so.

      wie teile ich die seite nochmal ein?

      Stehe grad übelst aufem schlauch :/


      habs, ging um frame/frameset und so.

      Chrynox
    • neue probleme...

      hab eine accordion subnavigation gebaut und will ein (css) popup für bilder.

      damit das popup bild nicht hinter dem accordion verschwindet muss ich in zeile 26 der accordion css overflow auf visible haben nur dann funktioniert das gesammte accordion in firefox nicht mehr alle anderen browser die ich getestet hab (chrome,ie,safari) haben damit kein problem.

      kann ich den overflow fürs bild irgendwie extra setzen? hab schon einiges probiert aber ich bekomms nicht hin -.-

      hab mal den code möglichst gecleaned...
      Spoiler anzeigen

      html:

      Quellcode

      1. <body>
      2. <!-- TOUR 1B culture & nature -->
      3. <div id="Accordion1" class="Accordion" tabindex="0">
      4. <div class="AccordionPanel">
      5. <div class="AccordionPanelTab">
      6. <h3>1st day</h3>
      7. <h4>You travel to a town called Emali and visit a typical kenyan market.</h4>
      8. </div>
      9. <div class="AccordionPanelContent"> <!--content tour1 day 1-->
      10. <p>On your first day your guide picks you at the agreed meeting point in Nairobi around 1 pm and you take a Matatu to a town called Emali.<br />
      11. <a class="thumbnail" href="#thumb"><img name="thumbn" src="" width="150" height="150" alt="justatest" border="0" /><span><img name="BIG" src="" width="450" height="450" alt="justatestBIG" /><br /><!--not Emali market--></span></a>
      12. Due to the climatic conditions, the inhabitants and the impacts of the high rate of HIV positive living people, Emali is quite a poor town. As a result the need for charity programs arises.</p>
      13. <p>During this optional walk you go through the market in town with small shops and people selling their wares next to the road. You also have the chance to visit Mt. Zion CBO with its clinic for people living with HIV, in order to get acquainted with the prevailing conditions that make Emali the town it is.<br />
      14. Your means of transport are Matatus and either on foot.<br />
      15. You stay overnight in a hotel in Emali.</p>
      16. </div>
      17. </div>
      18. <div class="AccordionPanel">
      19. <div class="AccordionPanelTab">
      20. <h3>2nd day</h3>
      21. <h4>A daytrip gives you the chance to visit a traditional Maasai family, talk to the people and learn about their way of life.</h4>
      22. </div>
      23. <div class="AccordionPanelContent">
      24. </div>
      25. </div>
      26. <div class="AccordionPanel">
      27. <div class="AccordionPanelTab">
      28. <h3>3rd day</h3>
      29. <h4>Optional you visit the Tumbuni Community in the morning. Afterwards you travel to a typical Kamba community and stay with the people.</h4>
      30. </div>
      31. <div class="AccordionPanelContent">
      32. </div>
      33. </div>
      34. <div class="AccordionPanel">
      35. <div class="AccordionPanelTab">
      36. <h3>4th day</h3>
      37. <h4>On your forth day you visit Tsavo West National Park where a hired car takes you around.</h4>
      38. </div>
      39. <div class="AccordionPanelContent">
      40. </div>
      41. </div>
      42. <div class="AccordionPanel">
      43. <div class="AccordionPanelTab">
      44. <h3>5th day</h3>
      45. <h4>A daytrip takes you the Ngangao forest which is protected under the Taita Wildlife Forum and a guide provides insight in this natural reserve.</h4>
      46. </div>
      47. <div class="AccordionPanelContent">
      48. </div>
      49. </div>
      50. <div class="AccordionPanel">
      51. <div class="AccordionPanelTab">
      52. <h3>6th day</h3>
      53. <h4>Two different hillstops and a Taita community are your destinations on your sixth day.</h4>
      54. </div>
      55. <div class="AccordionPanelContent">
      56. </div>
      57. </div>
      58. <div class="AccordionPanel">
      59. <div class="AccordionPanelTab">
      60. <h3>7th day</h3>
      61. <h4>In the morning your guide takes you to the next town on the Nairobi-Mombasa highway and from there we have to say goodbye.</h4>
      62. </div>
      63. <div class="AccordionPanelContent">
      64. </div>
      65. </div>
      66. </div>
      67. <script type="text/javascript">
      68. var Accordion1 = new Spry.Widget.Accordion("Accordion1", {useFixedPanelHeights: false, defaultPanel: -1 });
      69. </script>
      70. </body>
      Alles anzeigen


      accordion css:

      Quellcode

      1. @charset "UTF-8";
      2. .Accordion {
      3. overflow: hidden;
      4. outline:none;
      5. width:800px
      6. }
      7. .AccordionPanel {
      8. }
      9. .AccordionPanelTab {
      10. cursor: pointer;
      11. font-family: "Myriad Pro", Arial, Helvetica, sans-serif;
      12. color:black;
      13. margin:10px;
      14. -moz-user-select: none;
      15. -khtml-user-select: none;
      16. }
      17. .AccordionPanelContent {
      18. overflow:visible;
      19. margin: 0px;
      20. padding: 0px;
      21. padding-left:2em;
      22. }
      23. .AccordionPanelOpen .AccordionPanelTab {
      24. }
      25. .AccordionPanelTabHover {
      26. color:#754C24;
      27. }
      28. .AccordionPanelOpen .AccordionPanelTabHover {
      29. color:#754C24;
      30. }
      31. .AccordionFocused .AccordionPanelTab {
      32. }
      33. .AccordionFocused .AccordionPanelOpen .AccordionPanelTab {
      34. color:#754C24;
      35. }
      36. /* Rules for Printing */
      37. @media print {
      38. .Accordion {
      39. overflow: visible !important;
      40. }
      41. .AccordionPanelContent {
      42. display: block !important;
      43. overflow: visible !important;
      44. height: auto !important;
      45. }
      46. }
      Alles anzeigen


      popout css:

      Quellcode

      1. @charset "utf-8";
      2. /* CSS Document */
      3. .thumbnail{
      4. position: relative;
      5. float:right;
      6. z-index: 0;
      7. overflow:visible;
      8. }
      9. .thumbnail:hover{
      10. background-color: transparent;
      11. z-index: 50;
      12. }
      13. .thumbnail span{ /*CSS for enlarged image*/
      14. position: absolute;
      15. background-color:#CCC;
      16. padding: 5px;
      17. left: -1000px;
      18. visibility: hidden;
      19. color: black;
      20. text-decoration: none;
      21. }
      22. .thumbnail span img{ /*CSS for enlarged image*/
      23. border-width: 0;
      24. }
      25. .thumbnail:hover span{ /*CSS for enlarged image on hover*/
      26. visibility: visible;
      27. top: -20px;
      28. left: -300px;/*position where enlarged image should offset horizontally */
      29. }
      Alles anzeigen


      accordion js:

      Quellcode

      1. // SpryAccordion.js - version 0.17 - Spry Pre-Release 1.6.1
      2. //
      3. // Copyright (c) 2006. Adobe Systems Incorporated.
      4. // All rights reserved.
      5. //
      6. // Redistribution and use in source and binary forms, with or without
      7. // modification, are permitted provided that the following conditions are met:
      8. //
      9. // * Redistributions of source code must retain the above copyright notice,
      10. // this list of conditions and the following disclaimer.
      11. // * Redistributions in binary form must reproduce the above copyright notice,
      12. // this list of conditions and the following disclaimer in the documentation
      13. // and/or other materials provided with the distribution.
      14. // * Neither the name of Adobe Systems Incorporated nor the names of its
      15. // contributors may be used to endorse or promote products derived from this
      16. // software without specific prior written permission.
      17. //
      18. // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
      19. // AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
      20. // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
      21. // ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
      22. // LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
      23. // CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
      24. // SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
      25. // INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
      26. // CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
      27. // ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
      28. // POSSIBILITY OF SUCH DAMAGE.
      29. (function() { // BeginSpryComponent
      30. if (typeof Spry == "undefined") window.Spry = {}; if (!Spry.Widget) Spry.Widget = {};
      31. Spry.Widget.Accordion = function(element, opts)
      32. {
      33. this.element = this.getElement(element);
      34. this.defaultPanel = 0;
      35. this.hoverClass = "AccordionPanelTabHover";
      36. this.openClass = "AccordionPanelOpen";
      37. this.closedClass = "AccordionPanelClosed";
      38. this.focusedClass = "AccordionFocused";
      39. this.enableAnimation = true;
      40. this.enableKeyboardNavigation = true;
      41. this.currentPanel = null;
      42. this.animator = null;
      43. this.hasFocus = null;
      44. this.previousPanelKeyCode = Spry.Widget.Accordion.KEY_UP;
      45. this.nextPanelKeyCode = Spry.Widget.Accordion.KEY_DOWN;
      46. this.useFixedPanelHeights = true;
      47. this.fixedPanelHeight = 0;
      48. Spry.Widget.Accordion.setOptions(this, opts, true);
      49. if (this.element)
      50. this.attachBehaviors();
      51. };
      52. Spry.Widget.Accordion.prototype.getElement = function(ele)
      53. {
      54. if (ele && typeof ele == "string")
      55. return document.getElementById(ele);
      56. return ele;
      57. };
      58. Spry.Widget.Accordion.prototype.addClassName = function(ele, className)
      59. {
      60. if (!ele || !className || (ele.className && ele.className.search(new RegExp("\\b" + className + "\\b")) != -1))
      61. return;
      62. ele.className += (ele.className ? " " : "") + className;
      63. };
      64. Spry.Widget.Accordion.prototype.removeClassName = function(ele, className)
      65. {
      66. if (!ele || !className || (ele.className && ele.className.search(new RegExp("\\b" + className + "\\b")) == -1))
      67. return;
      68. ele.className = ele.className.replace(new RegExp("\\s*\\b" + className + "\\b", "g"), "");
      69. };
      70. Spry.Widget.Accordion.setOptions = function(obj, optionsObj, ignoreUndefinedProps)
      71. {
      72. if (!optionsObj)
      73. return;
      74. for (var optionName in optionsObj)
      75. {
      76. if (ignoreUndefinedProps && optionsObj[optionName] == undefined)
      77. continue;
      78. obj[optionName] = optionsObj[optionName];
      79. }
      80. };
      81. Spry.Widget.Accordion.prototype.onPanelTabMouseOver = function(e, panel)
      82. {
      83. if (panel)
      84. this.addClassName(this.getPanelTab(panel), this.hoverClass);
      85. return false;
      86. };
      87. Spry.Widget.Accordion.prototype.onPanelTabMouseOut = function(e, panel)
      88. {
      89. if (panel)
      90. this.removeClassName(this.getPanelTab(panel), this.hoverClass);
      91. return false;
      92. };
      93. Spry.Widget.Accordion.prototype.openPanel = function(elementOrIndex)
      94. {
      95. var panelA = this.currentPanel;
      96. var panelB;
      97. if (typeof elementOrIndex == "number")
      98. panelB = this.getPanels()[elementOrIndex];
      99. else
      100. panelB = this.getElement(elementOrIndex);
      101. if (!panelB || panelA == panelB)
      102. return null;
      103. var contentA = panelA ? this.getPanelContent(panelA) : null;
      104. var contentB = this.getPanelContent(panelB);
      105. if (!contentB)
      106. return null;
      107. if (this.useFixedPanelHeights && !this.fixedPanelHeight)
      108. this.fixedPanelHeight = (contentA.offsetHeight) ? contentA.offsetHeight : contentA.scrollHeight;
      109. if (this.enableAnimation)
      110. {
      111. if (this.animator)
      112. this.animator.stop();
      113. this.animator = new Spry.Widget.Accordion.PanelAnimator(this, panelB, { duration: this.duration, fps: this.fps, transition: this.transition });
      114. this.animator.start();
      115. }
      116. else
      117. {
      118. if(contentA)
      119. {
      120. contentA.style.display = "none";
      121. contentA.style.height = "0px";
      122. }
      123. contentB.style.display = "block";
      124. contentB.style.height = this.useFixedPanelHeights ? this.fixedPanelHeight + "px" : "auto";
      125. }
      126. if(panelA)
      127. {
      128. this.removeClassName(panelA, this.openClass);
      129. this.addClassName(panelA, this.closedClass);
      130. }
      131. this.removeClassName(panelB, this.closedClass);
      132. this.addClassName(panelB, this.openClass);
      133. this.currentPanel = panelB;
      134. return panelB;
      135. };
      136. Spry.Widget.Accordion.prototype.closePanel = function()
      137. {
      138. // The accordion can only ever have one panel open at any
      139. // give time, so this method only closes the current panel.
      140. // If the accordion is in fixed panel heights mode, this
      141. // method does nothing.
      142. if (!this.useFixedPanelHeights && this.currentPanel)
      143. {
      144. var panel = this.currentPanel;
      145. var content = this.getPanelContent(panel);
      146. if (content)
      147. {
      148. if (this.enableAnimation)
      149. {
      150. if (this.animator)
      151. this.animator.stop();
      152. this.animator = new Spry.Widget.Accordion.PanelAnimator(this, null, { duration: this.duration, fps: this.fps, transition: this.transition });
      153. this.animator.start();
      154. }
      155. else
      156. {
      157. content.style.display = "none";
      158. content.style.height = "0px";
      159. }
      160. }
      161. this.removeClassName(panel, this.openClass);
      162. this.addClassName(panel, this.closedClass);
      163. this.currentPanel = null;
      164. }
      165. };
      166. Spry.Widget.Accordion.prototype.openNextPanel = function()
      167. {
      168. return this.openPanel(this.getCurrentPanelIndex() + 1);
      169. };
      170. Spry.Widget.Accordion.prototype.openPreviousPanel = function()
      171. {
      172. return this.openPanel(this.getCurrentPanelIndex() - 1);
      173. };
      174. Spry.Widget.Accordion.prototype.openFirstPanel = function()
      175. {
      176. return this.openPanel(0);
      177. };
      178. Spry.Widget.Accordion.prototype.openLastPanel = function()
      179. {
      180. var panels = this.getPanels();
      181. return this.openPanel(panels[panels.length - 1]);
      182. };
      183. Spry.Widget.Accordion.prototype.onPanelTabClick = function(e, panel)
      184. {
      185. if (panel != this.currentPanel)
      186. this.openPanel(panel);
      187. else
      188. this.closePanel();
      189. if (this.enableKeyboardNavigation)
      190. this.focus();
      191. if (e.preventDefault) e.preventDefault();
      192. else e.returnValue = false;
      193. if (e.stopPropagation) e.stopPropagation();
      194. else e.cancelBubble = true;
      195. return false;
      196. };
      197. Spry.Widget.Accordion.prototype.onFocus = function(e)
      198. {
      199. this.hasFocus = true;
      200. this.addClassName(this.element, this.focusedClass);
      201. return false;
      202. };
      203. Spry.Widget.Accordion.prototype.onBlur = function(e)
      204. {
      205. this.hasFocus = false;
      206. this.removeClassName(this.element, this.focusedClass);
      207. return false;
      208. };
      209. Spry.Widget.Accordion.KEY_UP = 38;
      210. Spry.Widget.Accordion.KEY_DOWN = 40;
      211. Spry.Widget.Accordion.prototype.onKeyDown = function(e)
      212. {
      213. var key = e.keyCode;
      214. if (!this.hasFocus || (key != this.previousPanelKeyCode && key != this.nextPanelKeyCode))
      215. return true;
      216. var panels = this.getPanels();
      217. if (!panels || panels.length < 1)
      218. return false;
      219. var currentPanel = this.currentPanel ? this.currentPanel : panels[0];
      220. var nextPanel = (key == this.nextPanelKeyCode) ? currentPanel.nextSibling : currentPanel.previousSibling;
      221. while (nextPanel)
      222. {
      223. if (nextPanel.nodeType == 1 /* Node.ELEMENT_NODE */)
      224. break;
      225. nextPanel = (key == this.nextPanelKeyCode) ? nextPanel.nextSibling : nextPanel.previousSibling;
      226. }
      227. if (nextPanel && currentPanel != nextPanel)
      228. this.openPanel(nextPanel);
      229. if (e.preventDefault) e.preventDefault();
      230. else e.returnValue = false;
      231. if (e.stopPropagation) e.stopPropagation();
      232. else e.cancelBubble = true;
      233. return false;
      234. };
      235. Spry.Widget.Accordion.prototype.attachPanelHandlers = function(panel)
      236. {
      237. if (!panel)
      238. return;
      239. var tab = this.getPanelTab(panel);
      240. if (tab)
      241. {
      242. var self = this;
      243. Spry.Widget.Accordion.addEventListener(tab, "click", function(e) { return self.onPanelTabClick(e, panel); }, false);
      244. Spry.Widget.Accordion.addEventListener(tab, "mouseover", function(e) { return self.onPanelTabMouseOver(e, panel); }, false);
      245. Spry.Widget.Accordion.addEventListener(tab, "mouseout", function(e) { return self.onPanelTabMouseOut(e, panel); }, false);
      246. }
      247. };
      248. Spry.Widget.Accordion.addEventListener = function(element, eventType, handler, capture)
      249. {
      250. try
      251. {
      252. if (element.addEventListener)
      253. element.addEventListener(eventType, handler, capture);
      254. else if (element.attachEvent)
      255. element.attachEvent("on" + eventType, handler);
      256. }
      257. catch (e) {}
      258. };
      259. Spry.Widget.Accordion.prototype.initPanel = function(panel, isDefault)
      260. {
      261. var content = this.getPanelContent(panel);
      262. if (isDefault)
      263. {
      264. this.currentPanel = panel;
      265. this.removeClassName(panel, this.closedClass);
      266. this.addClassName(panel, this.openClass);
      267. // Attempt to set up the height of the default panel. We don't want to
      268. // do any dynamic panel height calculations here because our accordion
      269. // or one of its parent containers may be display:none.
      270. if (content)
      271. {
      272. if (this.useFixedPanelHeights)
      273. {
      274. // We are in fixed panel height mode and the user passed in
      275. // a panel height for us to use.
      276. if (this.fixedPanelHeight)
      277. content.style.height = this.fixedPanelHeight + "px";
      278. }
      279. else
      280. {
      281. // We are in variable panel height mode, but since we can't
      282. // calculate the panel height here, we just set the height to
      283. // auto so that it expands to show all of its content.
      284. content.style.height = "auto";
      285. }
      286. }
      287. }
      288. else
      289. {
      290. this.removeClassName(panel, this.openClass);
      291. this.addClassName(panel, this.closedClass);
      292. if (content)
      293. {
      294. content.style.height = "0px";
      295. content.style.display = "none";
      296. }
      297. }
      298. this.attachPanelHandlers(panel);
      299. };
      300. Spry.Widget.Accordion.prototype.attachBehaviors = function()
      301. {
      302. var panels = this.getPanels();
      303. for (var i = 0; i < panels.length; i++)
      304. this.initPanel(panels[i], i == this.defaultPanel);
      305. // Advanced keyboard navigation requires the tabindex attribute
      306. // on the top-level element.
      307. this.enableKeyboardNavigation = (this.enableKeyboardNavigation && this.element.attributes.getNamedItem("tabindex"));
      308. if (this.enableKeyboardNavigation)
      309. {
      310. var self = this;
      311. Spry.Widget.Accordion.addEventListener(this.element, "focus", function(e) { return self.onFocus(e); }, false);
      312. Spry.Widget.Accordion.addEventListener(this.element, "blur", function(e) { return self.onBlur(e); }, false);
      313. Spry.Widget.Accordion.addEventListener(this.element, "keydown", function(e) { return self.onKeyDown(e); }, false);
      314. }
      315. };
      316. Spry.Widget.Accordion.prototype.getPanels = function()
      317. {
      318. return this.getElementChildren(this.element);
      319. };
      320. Spry.Widget.Accordion.prototype.getCurrentPanel = function()
      321. {
      322. return this.currentPanel;
      323. };
      324. Spry.Widget.Accordion.prototype.getPanelIndex = function(panel)
      325. {
      326. var panels = this.getPanels();
      327. for( var i = 0 ; i < panels.length; i++ )
      328. {
      329. if( panel == panels[i] )
      330. return i;
      331. }
      332. return -1;
      333. };
      334. Spry.Widget.Accordion.prototype.getCurrentPanelIndex = function()
      335. {
      336. return this.getPanelIndex(this.currentPanel);
      337. };
      338. Spry.Widget.Accordion.prototype.getPanelTab = function(panel)
      339. {
      340. if (!panel)
      341. return null;
      342. return this.getElementChildren(panel)[0];
      343. };
      344. Spry.Widget.Accordion.prototype.getPanelContent = function(panel)
      345. {
      346. if (!panel)
      347. return null;
      348. return this.getElementChildren(panel)[1];
      349. };
      350. Spry.Widget.Accordion.prototype.getElementChildren = function(element)
      351. {
      352. var children = [];
      353. var child = element.firstChild;
      354. while (child)
      355. {
      356. if (child.nodeType == 1 /* Node.ELEMENT_NODE */)
      357. children.push(child);
      358. child = child.nextSibling;
      359. }
      360. return children;
      361. };
      362. Spry.Widget.Accordion.prototype.focus = function()
      363. {
      364. if (this.element && this.element.focus)
      365. this.element.focus();
      366. };
      367. Spry.Widget.Accordion.prototype.blur = function()
      368. {
      369. if (this.element && this.element.blur)
      370. this.element.blur();
      371. };
      372. /////////////////////////////////////////////////////
      373. Spry.Widget.Accordion.PanelAnimator = function(accordion, panel, opts)
      374. {
      375. this.timer = null;
      376. this.interval = 0;
      377. this.fps = 60;
      378. this.duration = 500;
      379. this.startTime = 0;
      380. this.transition = Spry.Widget.Accordion.PanelAnimator.defaultTransition;
      381. this.onComplete = null;
      382. this.panel = panel;
      383. this.panelToOpen = accordion.getElement(panel);
      384. this.panelData = [];
      385. this.useFixedPanelHeights = accordion.useFixedPanelHeights;
      386. Spry.Widget.Accordion.setOptions(this, opts, true);
      387. this.interval = Math.floor(1000 / this.fps);
      388. // Set up the array of panels we want to animate.
      389. var panels = accordion.getPanels();
      390. for (var i = 0; i < panels.length; i++)
      391. {
      392. var p = panels[i];
      393. var c = accordion.getPanelContent(p);
      394. if (c)
      395. {
      396. var h = c.offsetHeight;
      397. if (h == undefined)
      398. h = 0;
      399. if (p == panel && h == 0)
      400. c.style.display = "block";
      401. if (p == panel || h > 0)
      402. {
      403. var obj = new Object;
      404. obj.panel = p;
      405. obj.content = c;
      406. obj.fromHeight = h;
      407. obj.toHeight = (p == panel) ? (accordion.useFixedPanelHeights ? accordion.fixedPanelHeight : c.scrollHeight) : 0;
      408. obj.distance = obj.toHeight - obj.fromHeight;
      409. obj.overflow = c.style.overflow;
      410. this.panelData.push(obj);
      411. c.style.overflow = "hidden";
      412. c.style.height = h + "px";
      413. }
      414. }
      415. }
      416. };
      417. Spry.Widget.Accordion.PanelAnimator.defaultTransition = function(time, begin, finish, duration) { time /= duration; return begin + ((2 - time) * time * finish); };
      418. Spry.Widget.Accordion.PanelAnimator.prototype.start = function()
      419. {
      420. var self = this;
      421. this.startTime = (new Date).getTime();
      422. this.timer = setTimeout(function() { self.stepAnimation(); }, this.interval);
      423. };
      424. Spry.Widget.Accordion.PanelAnimator.prototype.stop = function()
      425. {
      426. if (this.timer)
      427. {
      428. clearTimeout(this.timer);
      429. // If we're killing the timer, restore the overflow
      430. // properties on the panels we were animating!
      431. for (i = 0; i < this.panelData.length; i++)
      432. {
      433. obj = this.panelData[i];
      434. obj.content.style.overflow = obj.overflow;
      435. }
      436. }
      437. this.timer = null;
      438. };
      439. Spry.Widget.Accordion.PanelAnimator.prototype.stepAnimation = function()
      440. {
      441. var curTime = (new Date).getTime();
      442. var elapsedTime = curTime - this.startTime;
      443. var i, obj;
      444. if (elapsedTime >= this.duration)
      445. {
      446. for (i = 0; i < this.panelData.length; i++)
      447. {
      448. obj = this.panelData[i];
      449. if (obj.panel != this.panel)
      450. {
      451. obj.content.style.display = "none";
      452. obj.content.style.height = "0px";
      453. }
      454. obj.content.style.overflow = obj.overflow;
      455. obj.content.style.height = (this.useFixedPanelHeights || obj.toHeight == 0) ? obj.toHeight + "px" : "auto";
      456. }
      457. if (this.onComplete)
      458. this.onComplete();
      459. return;
      460. }
      461. for (i = 0; i < this.panelData.length; i++)
      462. {
      463. obj = this.panelData[i];
      464. var ht = this.transition(elapsedTime, obj.fromHeight, obj.distance, this.duration);
      465. obj.content.style.height = ((ht < 0) ? 0 : ht) + "px";
      466. }
      467. var self = this;
      468. this.timer = setTimeout(function() { self.stepAnimation(); }, this.interval);
      469. };
      470. })(); // EndSpryComponent
      Alles anzeigen

    • ne genau das is mein problem
      in firefox funktionierts nicht
      wenn man overflow in zeile 26 der accordionX.css auf auto stellt gehts in firefox aber und das is das problem das popup funktioniert nicht mehr so wies soll (es verschwindet hinterm accordion)
    • wenn ich in der zeile 347 content.style.height auf auto setze oder sie ganz auskommentiere funktionierts beim ersten öffnen des accordion so wie es soll. wenn ich das tab aber schließe und wieder öffne oder von einem anderen tab auf ein zuvor geöffnetes zurückgehe ist alles beim alten und der text überlappt wieder.
      ich nehme mal and dass irgendwo wieder height 0 zurückgegeben wird hab aber keine ahnung wo...
    • Hi,

      würd gern helfen aber versteh das Problem nicht.
      Hab die Seite mal im FF 8 aufgerufen. Im ersten Link klappt ein Text auf und geht auch wieder zu. Nur danach buggt er sich in den restlichen Text wenn ich nochmal klicke.
      Ist das das beschriebene Problem?
      Return of the Ape
    • Benutzer online 1

      1 Besucher