[jQuery] code optimizing
[jQuery] code optimizing
hei everybody,
i got this little snipped and i am wondering about how to make it more efficient:
$('#respond').show();
$('#formComment').hide().addClass('javaCommentForm');
$("#respond").click(function(){
$('.storyBox').animate({"opacity": "0.4"});
$('#formComment').slideToggle();
$(this).css('visibility', 'hidden')
return false;
})
$('#closeComment').show().click(function(){
$('.storyBox').animate({"opacity": "1"});
$('#formComment').slideToggle();
$('#respond').fadeIn().css('visibility', 'visible');
return false;
})
should i put $('#formComment') in a var ? does it makes a different?
cheers chris!