With that code, you need two elements with these ids:
<div id="accordion">...</div>
<div id="accordion1">...</div>
Ids, not classes. For classes, it would look like this:
<div class="accordion">...</div>
<div class="accordion1">...</div>
$(function() {
$(".accordion").accordion();
$(".accordion1").accordion();
});
Better yet, with just one selector:
$(".accordion, .accordion1").accordion();
Or just use the same class for both (not possible with ids).
Jörn
On Fri, Aug 7, 2009 at 10:23 AM, Peter<[email protected]> wrote:
>
> Hi,
> How can I have two accordions on the same page? I have tried the using
> two different classes but that doesn't work.
> $(function() {
> $("#accordion").accordion();
> $("#accordion1").accordion();
> });
>
> Using the same class for both accordions causes only the first
> accordion to be rendered but not the last one in the page.
>
> Any help is greatly appreciated.
>
> Thanks,
> Peter.
> >
>
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"jQuery UI" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/jquery-ui?hl=en
-~----------~----~----~----~------~----~------~--~---