Hey. I want to do something similar to what you have done but not exactly the same.
I have a RSS feed that is embedded in my site. I would like to make it so if the title is longer than one line of the box that it is inside (266px wide) it will cut it off and put "...".
Is this possible? If not, is there a way of getting it to scroll the text? That may be an even better idea than cutting it off...... hmmmm?
you can still use the same function, you are going to calculate just the number that you are going to pass as an argument because function can not know how many characters are equal to 266 px, try couple times, pass 100, pass 50, pass 150, you will understand what you should pass.