EDIT: Give it a try now.
$(".boxes").on('click', function(e) {
e.preventDefault();
$(this).toggleClass('opened');
var heights = $(this).hasClass('opened') ? 300 : 100 ;
$(this).stop().animate({height: heights}); //Show clicked box
});