![](/img/trans.png)
[英]How to get the height and width of text in a span not the whole span width and height
[英]Is it possible to use jQuery to find height of a span of text with an undefined height?
我有一个<span>
的文本,不是由高度定义的。 内部文本是动态插入的,并且从该跨度的每个实例到另一个实例都有所不同。 有没有办法使用jQuery来找到这个跨度的高度?
这是我尝试过的:
parseInt($('span.tag_title', container).outerHeight(true), 10)
但除非我在CSS中定义跨度,否则这不会返回任何内容?
有人知道怎么修这个东西吗?
似乎工作...你不需要解析价值。 outerHeight返回一个int。 这是一个演示: http : //jsfiddle.net/V6Gx6/show
只需调整窗口大小。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.