Hi All.
I want to accordion an existing content format, and I think that I need
to insert a wrapper element. First I would love a sanity check on my
general approach then maybe someone can critique the manipulation I'm
trying.
Here's my content:
<div class="accordion">
<h3>heading</h3>
<arbitrary content/>
</div>
I can't change the content and I need the heading to be used as the
clickable bar.
The approach I want to take (on a high level) is:
- put a div around everything after the h3 in the dives classed
"accordion"
- put events on the h3 to show the associated div and hide the
non-associated divs
The js I would use is something like:
$("[EMAIL PROTECTED]").removeClass("accordion").addClass("accordionI
nner");
$("[EMAIL PROTECTED]").wrap('<div class="accordion"></div>');
//no luck here:
$("div:[EMAIL PROTECTED]").each(function(i){$(this).prepend($(this).chi
ldren("[EMAIL PROTECTED]:firstChild)})
//nor with this:
$("[EMAIL PROTECTED]").each(function(i){$(this).children("[EMAIL PROTECTED]
=accordionInner]:first-child").clone().prependTo(this)})
All suggestions welcome!
----------->Nathan
.:||:._.:||:._.:||:._.:||:._.:||:._.:||:._.:||:._.:||:._.:||:._.:||:._.:
||:.
Nathan Young
Cisco.com->Interface Development
A: ncy1717
E: [EMAIL PROTECTED]
_______________________________________________
jQuery mailing list
[email protected]
http://jquery.com/discuss/