There may be a difference between what the page looks like in the browser and the calculations used to determine if the text will overflow. The box model does not always behave the way we want. However, you can compare the inner width with the scroll width.
Here is a simple example that should correspond to an ellipse showing whether or not it is:
if ($('#div')[0].scrollWidth > $('#div').innerWidth()) {
I updated your fiddle and it works as I expect. Your scroll syntax was incorrect.
e.scrollWidth vs. $(e)[0].scrollWidth
Updated link to the new script:
http://jsfiddle.net/whipdancer/67upsqq8/1/
source share