jquery - Creating an accordion type content -


I'm trying to make something close to the jquery accordian, I'm not sure where I'm wrong.

Where the first box is open and when you click on the second box, the first one stops and the second opens

So far I have only managed to do this

My HTML

  & lt; Div class = "description" & gt; & Lt; P & gt; To use advertising for advertising, during his lifetime, he is known as a person. In such a way, or Eric can be used as a speaker. Due to undesirable unwanted invasions, enjoy a lifestyle for the lifestyle of your children's life. Download free of charge for Anopheon Antennae as a floor floor so far. The most important thing is that I use the materials used in the well for the first time for my work, pregnant women and dogs; Bought on the screen for a large scale mobile phone, by the name of any type, by the name of the curator or kangaroo, in any way. But how do you know about the Ultrasity Arch & Lt; / P & gt; & Lt; / Div & gt; & Lt; A href = "#" class = "toggle-link" & gt; + & Lt; / A & gt; & Lt; Div class = "description" & gt; & Lt; P & gt; Again, Bismunda Vyas is credited with the position of Justice Fatherratra in this situation that it is important to complete the results. Working as a major company, there is currently the possibility of being among novice students and students. Constants are the best way to consultants, which are however in spite of this type. Fascal Quinn Dollar Narusuda, Fujit et AC, Pantyur Essel. In SAD Actor Deepibus Aguay, Cabbatur Sollisidin, Collector of Scalarisac Headridge, Carrier's Cerility Management, and Management of Fellis It's Eatts in the Sagittas Legu congue are working for this time at the same time for one time, Donique Pauer Objects NIHH, A Allemcorpar NIHH Intermediate Site AMTa Mechanis Hendrates in full time as a result of Archu Uran is fully rotated. This type of ultrasis tortus id is Arque Pulviner, ID Fingilla Mets Artard, even a very accurate, ultransis a Ristro A, debentale or doler. The name is known, but it can not really be done in any way. & Lt; / P & gt; & Lt; / Div & gt; & Lt; A href = "#" class = "toggle-link" & gt; + & Lt; / A & gt;  

my jquery

  $ Fn.toggleClick = function () {var function = logic; Turn it back. (Function () {var iteration = $ (this) .data ('walk') || 0; functions [intent] .apply (this, argument); walk = (walk + 1)% function; length; $ (this ) .data ('walk', walk);}); }; Var $ dscr = $ ('Description'), $ switch = $ ('toggle-link'), initHeight = 40; // Initial height $ dscr.each (function () {$ (this) .data ("actualheit", $ (this) .it ()); // Create new property highsite). Css ({overflow: "hidden", height: initHeight}); $ Switch.toggleClick (function () {$ (this) .prevAll ('. Description: first'). ({Height: $ dscr.data ("realHeight"), 600); $ (this) .html (" - ");}, function () {$ dscr.animate ({height: initHeight}, 600); $ switch.html (" + ");});  

I do not know if you want to change the wheel again or toggle "click" "Why are you trying to reintegrate the method, but you are thinking things too much: it is easy:

  var initHeight = 40; // Initial height $ ('Description') .each (function (e) {$ (this) .data ("realahite", $ (this) .ht ());} Css ({height: initHeight, hidden delays'}); $ ('Toggle-link'). ('Click', function (e) {var $ desc = $ (this) .prev (); if ($ desc.hasClass ('open')) {$ (this) (.) ($): ($ - $ 'Desc.removeClass' ('height: initHeight', 600)} and {$ (this) Data ('realheight'), 600) .siblings ('open'). RemoveClass ('Open'). Sammet ({height: initHeight}, 600, function (e) {$ (this) .next () Text ('+');});}});  

Comments