I have a snippet of code that hides text after 1 line. Is there a way of modifying this so it hides after 2 lines? It needs to responsive so setting a fixed height or width isn't an option.
Fiddle http://jsfiddle.net/AlienWebguy/9t3Z5/3/
HTML
<div id="my_text" class="ellipsis">
Lorem ipsum dolor // lots more text
</div>
CSS
.ellipsis {
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
-o-text-overflow: ellipsis;
}
#my_text {
font-family:arial;
color:#333;
font-size:10px;
width:80%;
}
jQuery
$('#read_more').click(function(){
$('#my_text').toggleClass('ellipsis');
});