I would do this differently.
heading one
This is content for heading one
heading one
This is content for heading one
heading one
This is content for heading one
I would write the script as follows
this is a basic Jquery accordion with click event. can easily be converted
to
Thankyou very much Charlie, for the .find modfication, the working
example and the explanation of what is and what isn't a child or
sibling
Well done!
Thankyou from Josh H
On Jun 8, 8:16 pm, Charlie wrote:
> the reason it doesn't work is ul.links isn't a sibling of the li that click
> occurs
the reason it doesn't work is ul.links isn't a sibling of the li that
click occurs on, it is nested inside that li and therefore is a child.
In the Learning jQuery example, the div's that are being opened and
closed are siblings of the h3 that is being clicked
.next() will look for a sibling
3 matches
Mail list logo