Heres the code:
$('span.faqanswer').hide();
$('strong.faqlink').css('cursor','pointer').click(function(){
$(this).parent().find('span.faqanswer').slideToggle();
});
If you click the span.faqlink it just toggles but not slidetoggles. if you click again it slidetoggles.
this happens in any process. the downslide just toggles and the upslide slidetoggles…
jQuery’s animation relies upon the element having
heightandwidth. Sincespanis an inline element, it does not have these dimensions set or settable, so animations won’t work.It works while sliding up because the display is set to
inline-blockand it can be animated.I would suggest you to wrap the
spanin adivand then slide thedivinstead if it is possible to change your markup.Working demo – http://jsfiddle.net/ShankarSangoli/yTeAY/