I have given up doing this in pure js. And I can't find the jquery accordian stuff i was looking over when I started this project originally. What is the best way to do this? My code is linked here
+1
A:
Here is jQuery UI Accordion.
All you need is:
<div id="accordion">
<h3><a href="#">Section 1</a></h3>
<div>
<p>
Paragraph 1
</p>
</div>
<h3><a href="#">Section 2</a></h3>
<div>
<p>
Paragraph 2
</p>
</div>
</div>
and
$(document).ready(function() {
$("#accordion").accordion();
});
Jakub Konecki
2010-10-18 22:20:15
This doesn't answer how to create the headinsg and sections with the variables.
lazfish
2010-10-19 16:49:27
@lazfish - you're not actually asking for 'how to create the headinsg and sections with the variables', are you? If you want to generate DOM in js you might want to take a look at client-side templating (http://api.jquery.com/category/plugins/templates/)
Jakub Konecki
2010-10-19 18:34:06
Yeah I am reading over that now. I thought this would be easy.
lazfish
2010-10-19 19:35:33