I\'m trying to use jquery to write a fast function that calculates the pixel width of a string on a html page, then truncates the string until it reaches an ideal pixel widt
If you have the text, and know the size you want, why not just use substr?
I did something similar with
$('#history-1').text( $('#history-1').text().trim().substr(0,32) + "..." )