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

2008-02-23 Thread besh
Hi zephyr, try this: ... $('p.firstLine').click(function() { var $el = $(this).next(); $el.slideToggle('slow'); }); ... -- Bohdan Ganicky On Feb 23, 6:28 pm, zephyr <[EMAIL PROTECTED]> wrote: > Hi,I cannot get my finger behind this one: > > I have this HTML: > This is the first line of

[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

[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: > This is the first line of the first paragraph > And here is some more text. Bladibladibla > This is the first line of t

[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 don