[jQuery] toggle(fn, fn) does not execute
Hello,
I am new to jquery and I am having a problem with toggle( fn, fn). The code below does not seem to work (no errors though). But if I call toggle() with no arguments, it works fine. The thing is, I need to do different things on each click. Might this be a bug?
<script type="text/javascript">
$(function(){
$('.desc span:first-child')
.bind("click", function(){
$(this)
.next()
.toggle( function(){ $(this).hide(); },
function(){ $(this).show(); } );
});
});
</script>
I am using it with this markup:
<div class="row">
<div class="cell desc" id="s_desc">
<span id="s_desc_caption">description:</span>
<span id="s_desc_content">lorem ipsum...</span>
</div>
</div>
Thank you.
_______________________________________________
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/