Keep in mind that CSS never changes the DOM !!!
jQuery snippets:
$(function() {
$('a.link').each(function(e) {
var link = $(this).text();
if ( link.length > 100) {
$(this).attr('title', link );
}
});
});
Assuming you have links
<a class="link" href="" >the brown fox jumps over the lazy dog</a>
the wil code above produces
<a class="link" href="" title="the brown fox jumps over the lazy dog" >
the brown fox jumps over the lazy dog
</a>
the property text-overflow: ellipsis;will do the rest, as you know!
GOES FORWARD:
there is a small plugin
, jQuery Firefox. , ellipsis() jQuery. :
$("span").ellipsis();