This is what I would like it to do:
- Each red box (
<span class="more">) to show/hide the description (<div class="description">) - The “close” link to also hide the description
- If there is already a description open, this needs to close when another opens. So there is only ever one visible at a time.
Points 1 & 2, so far so good. But I’m stuck on point 3 – I’ve tried to find the other descriptions to hide them, but this fails!
$(".description").not(this).next(".description").removeClass("show")
Would anyone be able to help?
This should take care of it: http://jsfiddle.net/SMLwc/7/