Navigation auf-/ zuklappbar + drag&drop

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

  • hab dir den code nochmal aufs wesentliche reduziert

    siehe anhang

    Quellcode

    1. <html><head>
    2. <link href="demos.page_dateien/rico.css" media="all" rel="Stylesheet" type="text/css">
    3. <link href="demos.page_dateien/openrico.css" media="all" rel="Stylesheet" type="text/css">
    4. <link href="demos.page_dateien/rico_header.css" media="all" rel="Stylesheet" type="text/css">
    5. <link href="demos.page_dateien/ricoTests.css" media="all" rel="Stylesheet" type="text/css">
    6. <script src="demos.page_dateien/prototype" type="text/javascript"></script>
    7. <script src="demos.page_dateien/rico" type="text/javascript"></script>
    8. <script src="demos.page_dateien/util" type="text/javascript"></script>
    9. <title>Rico</title></head>
    10. <body onload="javascript:bodyOnLoad()">
    11. <script>
    12. var onloads = new Array();
    13. function bodyOnLoad() {
    14. new Rico.Effect.Round( null, 'roundNormal' );
    15. new Rico.Effect.Round( null, 'roundCompact', {compact:true} );
    16. for ( var i = 0 ; i < onloads.length ; i++ )
    17. onloads[i]();
    18. }
    19. showMenuContext()
    20. </script>
    21. <script>
    22. var saveHeight;
    23. var showing = true;
    24. function toggleSlide() {
    25. if ( showing )
    26. { slideMenuUp(); showing = false; }
    27. else
    28. { slideMenuDown(); showing = true; }
    29. }
    30. function slideMenuUp() {
    31. var menu = $('demosMenu');
    32. saveHeight = menu.offsetHeight;
    33. menu.style.overflow = "hidden";
    34. new Rico.Effect.Size( menu, null, 1, 120, 8 );
    35. $('demoPanelLink').innerHTML = "Show demo panel";
    36. }
    37. function slideMenuDown() {
    38. var menu = $('demosMenu');
    39. new Rico.Effect.Size( menu, null, saveHeight, 120, 8, {complete:function() { $(menu).style.overflow = "visible"; }} );
    40. $('demoPanelLink').innerHTML = "Hide demo panel";
    41. }
    42. </script>
    43. <!-- I did have this as float:right but it screws up in firefox -->
    44. <h2 style="padding-bottom: 0px;">ACCORDION EXAMPLE</h2>
    45. <p style="display: inline;">Single click title bar for any tab to show its content.</p>
    46. <div style="border-bottom: 1px solid rgb(31, 102, 155); margin-top: 6px; border-top-width: 1px; border-top-style: solid;" id="accordionExample">
    47. <div id="panel1">
    48. <div style="font-weight: normal; background-color: rgb(107, 121, 165); color: rgb(206, 215, 239);" id="panel1Header" class="accordionTabTitleBar">
    49. Overview
    50. </div>
    51. <div style="border-style: solid; border-color: rgb(31, 102, 155); border-width: 0px 1px; margin: 0px; overflow: hidden; height: 1px; display: none;" id="panel1Content" class="accordionTabContentBox">
    52. <br>This example illustrates how to use the Rico.Accordion behavior to transform a set of
    53. divs into a first class accordion component.<br><br>
    54. The Rico.Accordion behavior makes use of the Effect.AccordionSize which is an effect that simultaneously
    55. grows the height of one element while shrinking the height of another. The Rico.Accordion behavior adds
    56. the necessary event handlers on the respective divs to handle the visual aspects of expanding, collapsing
    57. and hovering.
    58. </div>
    59. </div>
    60. <div id="panel2">
    61. <div style="font-weight: normal; background-color: rgb(107, 121, 165); color: rgb(206, 215, 239);" id="panel2Header" class="accordionTabTitleBar">
    62. HTML Code
    63. </div>
    64. <div style="border-style: solid; border-color: rgb(31, 102, 155); border-width: 0px 1px; margin: 0px; overflow: hidden; height: 1px; display: none;" id="panel2Content" class="accordionTabContentBox">
    65. <br>The HTML structure is an outer div that holds all of the panels. Then, each panel is just a
    66. couple of DIVs (one for the header and one for the content) wrapped in an outer DIV.
    67. <pre>&lt;div id="accordionDiv"&gt;
    68. &lt;div id="overviewPanel"&gt;
    69. &lt;div id="overviewHeader"&gt;
    70. Overview
    71. &lt;/div&gt;
    72. &lt;div id="panel1Content"&gt;
    73. ... content text ...
    74. &lt;/div&gt;
    75. &lt;/div&gt;
    76. &lt;/div&gt;
    77. </pre>
    78. </div>
    79. </div>
    80. <div id="panel3">
    81. <div style="font-weight: bold; background-color: rgb(99, 105, 156); color: rgb(255, 255, 255);" id="panel3Header" class="accordionTabTitleBar">
    82. Rico Code
    83. </div>
    84. <div style="border-style: solid; border-color: rgb(31, 102, 155); border-width: 0px 1px; margin: 0px; height: 227px; overflow: visible;" id="panel3Content" class="accordionTabContentBox">
    85. <br>To attach the accordion behavior to the accordion container div, construct a Rico.Accordion
    86. object and pass the container to it. Thats it!
    87. <pre>new Rico.Accordion( $('accordionDiv') );
    88. -or-
    89. new Rico.Accordion( $('accordionDiv'), {panelHeight:300} );</pre>
    90. The second example specifies the height of the accordion panels. There are many other
    91. configuration parameters that can be specified to modify various visual aspects of the
    92. accordion. The panelHeight is the attribute that is most commonly overridden.
    93. </div>
    94. </div>
    95. <div id="panel4">
    96. <div style="font-weight: normal; background-color: rgb(107, 121, 165); color: rgb(206, 215, 239);" id="panel4Header" class="accordionTabTitleBar">
    97. Important Note
    98. </div>
    99. <div style="border-style: solid; border-color: rgb(31, 102, 155); border-width: 0px 1px; margin: 0px; overflow: hidden; height: 1px; display: none;" id="panel4Content" class="accordionTabContentBox">
    100. <br>The content div for each panel should not be styled to have borders, margins, or padding.
    101. When padding/margin is required, nest another DIV inside the content div and style it accordingly.
    102. Also, the panel content should not grow beyond the panelHeight attribute of the configuration
    103. parameter. On Firefox/Mac the scrollbar for an overflow area will cause the scrollbar to
    104. always be visible--even when the panel is collapsed. You can resolve this by setting the
    105. visibility of the contents when the panel starts to collapse or expand.<br>&nbsp;
    106. </div>
    107. </div>
    108. </div>
    109. <script> onloads.push( accord ); function accord() { new Rico.Accordion( 'accordionExample', {panelHeight:227} ); } </script>
    110. </body></html>
    Alles anzeigen
    Dateien
  • hm.. du meinst jetzt den wordpress admin bereich, oder?
    ich dachte du meinst das teil von wordpress.de (das genauso aussieht, wie das beispiel oben)

    der wordpress admin code ist nämlich gaaanz simpel
    ohne diesen rollovereffekt und ohne, dass die 3 flächen sich variable nach unten oder oben bewegen um den inhalt immer an ähnlicher position zu behalten

    hier ein beispiel von Max123 aus dem Thread JavaScript Text verbergen & anzeigen

    "Max123" schrieb:

    Demo

    Quellcode

    1. <html><head>
    2. <script type="text/javascript">
    3. function show (member) {
    4. if (document.getElementById) {
    5. if (document.getElementById(member).style.display == "block") {
    6. document.getElementById(member).style.display = "none";
    7. } else {
    8. document.getElementById(member).style.display = "block";
    9. }
    10. }
    11. }
    12. </script>
    13. </head><body>
    14. <a href="javascript:show('B')">B anzeigen</a><br>
    15. <table id="B" style="display:none">
    16. <tr><td>B's Details</td></tr>
    17. </table>
    18. <a href="javascript:show('C')">C anzeigen</a><br>
    19. <table id="C" style="display:none">
    20. <tr><td>C's Details</td></tr>
    21. </table>
    22. <a href="javascript:show('A')">A anzeigen</a><br>
    23. <table id="A" style="display:none">
    24. <tr><td>A's Details</td></tr>
    25. </table>
    26. </body></html>
    Alles anzeigen
  • hey.. danke, das habe ich auch gelesen.
    das ist ja kein ajax *fg*

    so in der art habe ich auch was bei dynamicpages.com gefunden, aber nur javascript.

    Wie im Amdinbereich von wordpress würde ich es gerne aufbauen.

    switchbar. soll offenbleiben beim link klicken- und die navigation soll selber anpassbar sein, also eben genau diese funktionen wie im wordpress.

    das rauszufiltern habe ich einfach nicht geschafft.
  • hab jetzt das script von Max123 mit AJAX Features versehen..
    aber ich nutze selber WordPress2.. weiß aber noch nicht genau, was du meinst.. vielleicht hilt dir das ja weier:

    func.php musst du selber erstellen
    les dazu mein Wiki Tutorial: [coderwiki]HowTos/Ajax-Inhalte-mit-PHP-nachladen[/coderwiki]

    Quellcode

    1. <html><head>
    2. <script type="text/javascript">
    3. <!--
    4. function createXMLHttpRequest() {
    5. var ua;
    6. if(window.XMLHttpRequest) {
    7. try {
    8. ua = new XMLHttpRequest();
    9. } catch(e) {
    10. ua = false;
    11. }
    12. } else if(window.ActiveXObject) {
    13. try {
    14. ua = new ActiveXObject("Microsoft.XMLHTTP");
    15. } catch(e) {
    16. ua = false;
    17. }
    18. }
    19. return ua;
    20. }
    21. var req = createXMLHttpRequest();
    22. function sendRequest(digit) {
    23. show(digit);
    24. req.open('get', 'func.php?s='+ digit);
    25. req.onreadystatechange = handleResponse;
    26. req.send(null);
    27. }
    28. function handleResponse() {
    29. if(req.readyState == 4){
    30. var response = req.responseText;
    31. var update = new Array();
    32. if(response.indexOf('||' != -1)) {
    33. update = response.split('||');
    34. for(i=0; i<update.length; i+=2) {
    35. document.getElementById(update[i]).innerHTML = update[i+1];
    36. }
    37. }
    38. }
    39. else
    40. alert("loading" + ajax.readyState);
    41. }
    42. function show (member) {
    43. if (document.getElementById) {
    44. if (document.getElementById(member).style.display == "block") {
    45. document.getElementById(member).style.display = "none";
    46. } else {
    47. document.getElementById(member).style.display = "block";
    48. }
    49. }
    50. }
    51. //-->
    52. </script></head><body>
    53. <a href="#" onClick="sendrequest('B')">B anzeigen</a><br>
    54. <table id="B" style="display: none;">
    55. <tr><td>B's Details</td></tr>
    56. </table>
    57. <a href="#" onClick="sendrequest('C')">C anzeigen</a><br>
    58. <table id="C" style="display: none;">
    59. <tr><td>C's Details</td></tr>
    60. </table>
    61. <a href="#" onClick="sendrequest('A')">A anzeigen</a><br>
    62. <table id="A" style="display: none;">
    63. <tr><td>A's Details</td></tr>
    64. </table>
    65. </body></html>
    Alles anzeigen
  • Hey erstmal ein dickes Lob.

    Du setzt Dich wirklich ein, sowas findest man selten.

    In den Downloadfiles findet man eine menge beispiele.

    Ich habe dieses hier genommen:

    Quellcode

    1. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    2. <html xmlns="http://www.w3.org/1999/xhtml">
    3. <head>
    4. <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
    5. <title>Untitled Document</title>
    6. <script src="prototype.js" type="text/javascript"></script>
    7. <script src="scriptaculous.js" type="text/javascript"></script>
    8. </head>
    9. <body>
    10. <style type="text/css">
    11. #menu {
    12. width: 300px;
    13. border: 1px #000 solid;
    14. }
    15. .menu_header {
    16. background-color: #00CC99;
    17. color: #FFFFFF;
    18. }
    19. .menu_block {
    20. background-color: #006699;
    21. color: #FFFFFF;
    22. overflow:hidden;
    23. }
    24. .menu_block div {
    25. }
    26. .close_block {
    27. position: relative;
    28. width: 100%;
    29. bottom: 0px;
    30. height: 15px;
    31. text-align: center;
    32. display: block;
    33. }
    34. </style>
    35. <div id="menu">
    36. <div class="menu_header" id="menu_header1"><a href="#" onClick="new Effect.SlideDown('menu_block1'); return false;">HEADER 1</a></div>
    37. <div class="menu_block_container" id="menu_block_container1">
    38. <div class="menu_block" id="menu_block1"><div>
    39. text<br>
    40. text<br>
    41. text<br>
    42. text<br>
    43. text<br>
    44. text<br>
    45. text<br>
    46. <a href="#" class="close_block" onClick="new Effect.SlideUp('menu_block1'); return false;">close</a></div></div>
    47. </div>
    48. <div class="menu_header" id="menu_header2"><a href="#" onClick="new Effect.SlideDown('menu_block2'); return false;">HEADER 2</a></div>
    49. <div class="menu_block_container" id="menu_block_container2">
    50. <div class="menu_block" id="menu_block2"><div>
    51. text<br>
    52. text<br>
    53. text<br>
    54. text<br>
    55. text<br>
    56. text<br>
    57. text<br>
    58. <a href="#" class="close_block" onClick="new Effect.SlideUp('menu_block2'); return false;">close</a></div></div>
    59. </div>
    60. </div>
    61. </body>
    62. </html>
    Alles anzeigen