切り替え可能にする必要があるさまざまな高さの複数のdivがあり、これらの各divには同じクラスがあります。これを達成するための最良の方法は何ですか?
$('.smallify').on('click', function() {
if ($(this).parent('.container').css('height', '');) {
$(this).parent('.container').css('height', '20px');
} else {
$(this).parent('.container').css('height', '');
});