[jQuery] Re: Toggle working, but 2 clicks are needed ... (noob question?)

2007-09-19 Thread Fanck
Thanks. Indeed it worked fine, and you're way is much more clean ^^ On 19 sep, 17:44, "Glen Lipka" <[EMAIL PROTECTED]> wrote: > I usually avoid putting onClick events in the html and do it all in the JS. > > Like > $("span.control a).toggle(function(){ > $(this).addClass("selected");},function(

[jQuery] Toggle working, but 2 clicks are needed ... (noob question?)

2007-09-19 Thread Fanck
hi, here's the code I use: image('nav/expand.png', array('class' => 'expand'));?> image('nav/reduce.png', array('class' => 'reduce'));?> function toggleFnct(handle) { handle.parent().toggle( function(){ $('img.expand').show(); $('img.reduce').hide();