View Full Version : Text truncating with hyperlink

12-13-2009, 03:59 AM
I couldnt find what I was looking for in a search and am kinda pressed for time so Im hoping this question isnt a stupid one to ask here ...

I am working on a portfolio. It has a image above a short, 4 line, description. However I'd like to be able to add more description and have it truncate to 4 lines. Instead of a link to expand the div though, i'd rather just have a hyperlink to the project page instead. Is this something that can be done automatically or do I need to just limit the div myself and add the hyperlink there ?

Basicly i'd like ...

Project Screenshot |

Project Name
short description of the project goes here and
truncates after 3 lines.

[ view complete description ] <-- This just links to the project page instead of expanding the div to fit all the text. (which is what i mainly find online)

Thanks in advance :)

12-13-2009, 04:19 AM
Server-side scripting could do this but limiting it to 4 lines on the page would be difficult. You could limit it to a specific number of words or characters very easily though. Were you looking specifically for a javascript solution for this or is server-side something that you're interested in?