Is it possible to detect if text is longer than one line in my div?
There is a jQuery plugin that may suit your needs: http://jedfoster.com/Readmore.js/
You can compare DIV width
with scrollWidth
to detect if text is overflowing:
if ($('.less')[0].scrollWidth <= $('.less').width()) {
$(".text-size").hide();
}
Demo: http://jsfiddle.net/ygalanter/M2APS/50/