[jQuery] Re: How to select an element based on visibility

2008-02-23 Thread Karl Swedberg
You're very close. The .slideToggle() method will slide down if hidden and up if visible: $(document).ready(function(){ $(.firstLine).click(function(){ $(this).next().slideToggle('slow'); }); }); Working with your code the way you had it, you could have done

[jQuery] Re: How to select an element based on visibility

2008-02-23 Thread Cloudream
el.click(function(){ $(this).slideToggle('slow'); }); On Feb 24, 1:28 am, zephyr [EMAIL PROTECTED] wrote: Hi,I cannot get my finger behind this one: I have this HTML: p class=firstLineThis is the first line of the first paragraph/p pAnd here is some more text. Bladibladibla/p p

[jQuery] Re: How to select an element based on visibility

2008-02-23 Thread zephyr
Thanks Karl, this works. Very instructive - didn't know the syntax of the is and ternary operator in jQuery. I'll check out learningjquery! Marc