Thank you Karl,
I realised the difference between the two functions: toggle() triggers the
show/hide effect and toggle(fn,fn) is an event handler.
Here is what i wanted to achieve:

$(function(){
$('.desc div:first-child')
.toggle( function(){
$(this).next().hide('fast').end().append('<b><...></b>'); },
            function(){ $(this).next().show('fast'); $('b', this).remove();
} );
})

clicking a form caption hides the textarea below it and appends an
indication that there is hidden content below the caption. Clicking again
shows the hidden textarea and removes the indication.
_______________________________________________
jQuery mailing list
[email protected]
http://jquery.com/discuss/

Reply via email to