[jQuery] Re: Toggle(fn, fn), need to click twice to re-open the content

2009-03-19 Thread Rodrigo
Whoa thanks both of you! I've been trying to fix this in a long time. Awesome, thank you again! On Mar 20, 12:42 am, Rodolfo Allan wrote: > When I needed something like that, I've discovered the same and got this > workaround: > > $(".title").click(function(){ > >         if($(this).next(".con

[jQuery] Re: Toggle(fn, fn), need to click twice to re-open the content

2009-03-19 Thread Rodolfo Allan
When I needed something like that, I've discovered the same and got this workaround: $(".title").click(function(){ if($(this).next(".content").is(":hidden") == true) { $(this).next(".content").show().html('a');} } else { $(this).

[jQuery] Re: Toggle(fn, fn), need to click twice to re-open the content

2009-03-19 Thread James
The toggle function keeps track of the click count internally and calls the callback function based on that, and not based on the status of your elements. This means clicking on something else that modifies your elements will not affect the internal toggle count. I suggest, rather than using toggl