Mark Lyons
Mark Lyons

Reputation: 1422

Is it possible to use jQuery to find height of a span of text with an undefined height?

I have a <span> of text that isn't defined by height. The text inside is inserted dynamically and varies from each instance of this span to the other. Is there any way to use jQuery to find the height of this span?

Here's what I've tried:

parseInt($('span.tag_title', container).outerHeight(true), 10)

But that doesn't return anything unless I define the span in CSS?

Anyone know how to fix this?

Upvotes: 4

Views: 3861

Answers (1)

Joseph Marikle
Joseph Marikle

Reputation: 78550

seems to work... you don't need to parse the value though. outerHeight returns an int. Here's a demo: http://jsfiddle.net/V6Gx6/show

Just resize the window.

Upvotes: 5

Related Questions