Mootools accordion Problem

Mootools accordion Problem |

Erstellt von KdV_BierZelt, 17.09.2008.

  1. KdV_BierZelt

    KdV_BierZelt Guest

    Mootools accordion Problem
    HI, ich dass oben genannt Scipt in meine Webseite eingebaut. Funktioniert wunderbar aber am Anfang wenn man die Seite aufruft sollen alle tabs/accordions geschlossen sein her das js script

    Code (Text):
    1. window.addEvent('domready', function() {
    3.     //create our Accordion instance
    4.     var myAccordion = new Accordion($('accordion'), 'h3.toggler', 'div.element', {
    5.                 onActive: function(toggler, element){
    6.             toggler.setStyle('color', '#804000');
    7.         },
    8.         onBackground: function(toggler, element){
    9.             toggler.setStyle('color', '#804000');
    10.         }
    11.     });
    13.     //add click event to the "add section" link
    14.     $('add_section').addEvent('click', function(event) {
    15.         event.stop();
    17.         // create toggler
    18.         var toggler = new Element('h3', {
    19.             'class': 'toggler',
    20.             'html': 'Common descent'
    21.         });
    23.         // create content
    24.         var content = new Element('div', {
    25.             'class': 'element',
    26.             'html': '<p>A group of organisms is said to have common descent if they have a common ancestor. In biology, the theory of universal common descent proposes that all organisms on Earth are descended from a common ancestor or ancestral gene pool.</p><p>A theory of universal common descent based on evolutionary principles was proposed by Charles Darwin in his book The Origin of Species (1859), and later in The Descent of Man (1871). This theory is now generally accepted by biologists, and the last universal common ancestor (LUCA or LUA), that is, the most recent common ancestor of all currently living organisms, is believed to have appeared about 3.9 billion years ago. The theory of a common ancestor between all organisms is one of the principles of evolution, although for single cell organisms and viruses, single phylogeny is disputed</p>'
    27.         });
    29.         // position for the new section
    30.         var position = 0;
    32.         // add the section to our myAccordion using the addSection method
    33.         myAccordion.addSection(toggler, content, position);
    34.     });
    35. });
  2. stb_87

    stb_87 Web-Sheriff - ohne Bild

    Dabei seit:
    dies & das
    Mootools accordion Problem
    AW: Mootools accordion Problem

    Ja super!

    Wie bindest du das Script denn überhaupt in deine Website ein?
    Ist JavaScript aktiviert in deinem Browser?
  3. KdV_BierZelt

    KdV_BierZelt Guest

    Mootools accordion Problem
    AW: Mootools accordion Problem

    ja klar es funktioniert ja auch, aber es sollen alle am anfang geschlossen sein weil jetzt wenn ich die seite aufrufe ist immer ein accordion offen. leider kenne ich mich eben mit mootools ned aus deswegen wollt ich fragen ob das jemand für mich machen kann und ich habe diesen code gepostet falls man diesen braucht was ich schwer vermute. tut mir leid wenn ich mich vielleicht ein bisserl unklar ausgedrückt habe.

  4. Christian

    Christian verpeilt & verschallert

    Dabei seit:
    Canon EOS 300D
    Mootools accordion Problem
    AW: Mootools accordion Problem

    poste doch mal den gesamten Kontext, denn ich habe leider keine Lust mir das zu ergoogeln =)
  5. KdV_BierZelt

    KdV_BierZelt Guest

    Mootools accordion Problem
    AW: Mootools accordion Problem

    ok also hier die html datei.

    1. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "">
    2. <html xmlns="" xml:lang="en" lang="en">
    3.     <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    4.     <link rel="stylesheet" href="demo.css" type="text/css" />
    5.     <script type="text/javascript" src="../mootools.js"></script>
    6.     <script type="text/javascript" src="demo.js"></script>
    7.     <title>Accordion Demo</title>
    8. </head>
    9.     <h1>Accordion</h1>
    10.     <h2>Introduction</h2>
    11.     <p>
    12.         The Accordion gives you a fancy way to only show the really needed content.
    13.     </p>
    14.     <hr />
    15.     <div>
    16.         <a id="add_section" href="#">add section</a>
    17.     </div>
    18.     <div id="accordion">
    19.         <h3 class="toggler">History</h3>
    20.         <div class="element">
    21.             <h4>Common ancestor</h4>
    22.             <p>The first suggestion that all organisms may have had a common ancestor and diverged through random variation and natural selection was made in 1745 by the French mathematician and scientist Pierre-Louis Moreau de Maupertuis (1698-1759) in his work Venus physique. Specifically:</p>
    23.             <blockquote>"Could one not say that, in the fortuitous combinations of the productions of nature, as there must be some characterized by a certain relation of fitness which are able to subsist, it is not to be wondered at that this fitness is present in all the species that are currently in existence? Chance, one would say, produced an innumerable multitude of individuals; a small number found themselves constructed in such a manner that the parts of the animal were able to satisfy its needs; in another infinitely greater number, there was neither fitness nor order: all of these latter have perished. Animals lacking a mouth could not live; others lacking reproductive organs could not perpetuate themselves... The species we see today are but the smallest part of what blind destiny has produced..."</blockquote>
    24.             <h4>The Origin of Species</h4>
    25.             <p>In 1859, Charles Darwin's The Origin of Species was published. The views about common descent expressed therein vary between suggesting that there was a single "first creature" to allowing that there may have been more than one. Here are the relevant quotations from the Conclusion:</p>
    26.             <blockquote>"[P]robably all of the organic beings which have ever lived on this earth have descended from some one primordial form, into which life was first breathed."<br />"The whole history of the world, as at present known, ... will hereafter be recognised as a mere fragment of time, compared with the ages which have elapsed since the first creature, the progenitor of innumerable extinct and living descendants, was created."<br />"When I view all beings not as special creations, but as the lineal descendants of some few beings which lived long before the first bed of the Silurian system was deposited, they seem to me to become ennobled."</blockquote>
    27.             <p>The famous closing sentence describes the "grandeur in this view of life, with its several powers, having been originally breathed into a few forms or into one." The phrase "one form" here seems to hark back to the phrase "some few beings"; in any case, the choice of words is remarkable for its consistency with recent ideas about there having been a single ancestral "genetic pool".</p>
    28.         </div>
    30.         <h3 class="toggler">Evidence of universal common descent</h3>
    31.         <div class="element">
    32.             <h4>Common biochemistry and genetic code</h4>
    33.             <p>All known forms of life are based on the same fundamental biochemical organization: genetic information encoded in DNA, transcribed into RNA, through the effect of protein- and RNA-enzymes, then translated into proteins by (highly similar) ribosomes, with ATP, NADH and others as energy currencies, etc. Furthermore, the genetic code (the "translation table" according to which DNA information is translated into proteins) is nearly identical for all known lifeforms, from bacteria to humans, with minor local differences. The universality of this code is generally regarded by biologists as definitive evidence in favor of the theory of universal common descent. Analysis of the small differences in the genetic code has also provided support for universal common descent.[2]</p>
    34.             <img src="images/phylogenetic_tree.png" width="340" height="230" align="right" alt="" />
    35.             <p>The universality of many aspects of cellular life is often pointed to as supportive evidence to the more compelling evidence listed above. These similarities include the energy carrier ATP, and the fact that all amino acids found in proteins are left-handed. It is possible that these similarities resulted because of the laws of physics and chemistry, rather than universal common descent and therefore resulted in convergent evolution.</p>
    36.             <h4>Phylogenetic trees</h4>
    37.             <p>Another important piece of evidence is that it is possible to construct detailed phylogenetic trees mapping out the proposed divisions and common ancestors of species, and no matter what method is used, morphological (based on appearance, embryology, etc) or molecular (based on mutation rates and relative similarities of important, conserved genes), still get extremely similar results. If there were no common ancestor, these different methods should give wildly different results, thus the phylogenetic tree is strong evidence of common descent.</p>
    38.         </div>
    40.         <h3 class="toggler">Examples of common descent</h3>
    41.         <div class="element">
    42.             <h4>Artificial selection</h4>
    43.             <p>Artificial selection offers remarkable examples of the amount of diversity that can exist between individuals sharing a late common ancestor. To perform artificial selection, one begins with a particular species (following examples include wolves and wild cabbage) and then, at every generation, only allow certain individuals to reproduce, based on the degree to which they exhibit certain desirable characteristics. In time, it is expected that these characteristics become increasingly well-developed in successive generations. Many examples of artificial selection, like the ones below, occurred without the guidance of modern scientific insight.</p>
    44.             <img src="images/biglittledog.jpg" width="180" height="151" align="right" alt="" />
    45.             <h4>Dog breeding</h4>
    46.             <p>An obvious example of the power of artificial selection is the diversity found in various breed in domesticated dogs. The various breeds of dogs all share common ancestry (being all ultimately descended from wolves) but were domesticated by humans and then selectively bred in order to enhance various features such as coat color and length or body size. To see the wide range of difference between the many breeds of dogs compare the Chihuahua, Great Dane, Basset Hound, Pug, and Poodle. Also compare this enormous diversity with the relative uniformity of wild wolves.</p>
    47.         </div>
    48.     </div>
    49. </body>
    50. </html>
    und das js is ja oben schon.

  6. LowkaZ

    LowkaZ Half Life

    Dabei seit:
    Textmate, WordPress, jQuery, PHP5, MySQL, CSS3, HTML5
    Mootools accordion Problem
    AW: Mootools accordion Problem

    du solltest dir die doc vom accordion durchlesen da steht es drin mit welchem parameter du das ding geschlossen hälst...