Jquery firefox中的长标题属性文本被截断
我正在使用HTML5。我正在使用J query动态设置标题属性文本。如果我有一个标题属性,其中有一个长文本(HTML元素被截断),那么工具提示就会被切断。这只发生在Firefox(仅测试版本37.0)中,在chrome和Internet explorer中,它显示完整的标题属性长文本。 HTML代码是Jquery firefox中的长标题属性文本被截断,jquery,html,css,Jquery,Html,Css,我正在使用HTML5。我正在使用J query动态设置标题属性文本。如果我有一个标题属性,其中有一个长文本(HTML元素被截断),那么工具提示就会被切断。这只发生在Firefox(仅测试版本37.0)中,在chrome和Internet explorer中,它显示完整的标题属性长文本。 HTML代码是 <table id="notify_time"> <tr> <td style="padding-right:10px;width:10p
<table id="notify_time">
<tr>
<td style="padding-right:10px;width:10px">
<div class="time">${notificationEntry.time}</div>
</td>
<td>
<div class="desc">${notificationEntry.content}</div>
</td>
</tr>
</table>
您能提供一个更完整的JSFIDLE示例吗?我给你开了一个:是的,马克。这是我在Firefox37上的工具提示中看到的:似乎只有在检查HTML元素时标题属性才被截断。在所有其他情况下,将显示完整标题属性。@MarcB。在我的例子中,title属性在windows8和windows7 Firefox 37上被截断。在OS Ubuntu、Firefox版本37中,标题属性未被截断
$('.desc').bind('mouseenter', function(){
var $this = $(this);
if(this.offsetWidth < this.scrollWidth && !$this.attr('title')){
$this.attr('title', $this.text());
}
});
.desc {
max-width: 235px;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
cursor: default;
font-size: 12px
}