optimized box-height javascript