[jQuery] Toggle working, but 2 clicks are needed ... (noob question?)
hi,
here's the code I use:
<pre>
<span class="control hide">
<a href="#" onClick="toggleFnct($(this))">
<?php echo $html->image('nav/expand.png', array('class' =>
'expand'));?>
<?php echo $html->image('nav/reduce.png', array('class' =>
'reduce'));?>
</a>
</span>
function toggleFnct(handle) {
handle.parent().toggle(
function(){
$('img.expand').show();
$('img.reduce').hide();
$('#rss0').hide();
},
function(){
$('img.expand').hide();
$('img.reduce').show();
$('#rss0').show();
}
);
}
</pre>
But using that I need to click twice to get it working. Anyone got an
idea why?
Thanks in advance