I have a <div>
of constrained size, and I want to put multiline text in it, but if it's going to overflow, I'd like to put a "..." at the end with a link to view the entire content on another page.
Is this doable in Javascript/CSS? I tried searching a bit but I'm not sure what to look for.
Hmm -- looks like there's a CSS text-overflow: ellipsis;
but I don't think I can put a link on the ellipsis.
this answer is really close but there are cases where if it just starts to overflow then only part of the ellipsis shows up.
library requirements: I can use jQuery (somewhat reluctantly), would prefer a no-framework-dependency cross-browser solution.