The following code uses jQuery to get height and comparison. Please note that it should probably be visible where you call it in order to have a valid height.
$(function() {
$(".tabs").each( function() {
var $this = $(this);
if ($this.height() > 270) {
$this.css( 'overflow-y', 'scroll' );
}
});
});
Note. This will work with all elements with class tabs, not just the first one.
source
share