我的下一個DIV:顯示工具提示只有當省略號活躍
<div class="div-class" style="width:158px;text-overflow:ellipsis;overflow:hidden;white-space:nowrap;" title=<%=myDesc%>
我怎麼能顯示只有省略號是活動的提示?
我覺得這個功能
function isEllipsisActive(e) {
return (e.offsetWidth < e.scrollWidth);
}
但我不知道如何使用它知道我用JSP和Struts
既然你設置當_would_溢出時將被削減的內容,你不會再有任何溢出,你可以檢查...你必須這樣做_before_應用溢出:隱藏。 – CBroe
[HTML - 如何在顯示省略號時激活工具提示](http://stackoverflow.com/questions/5474871/html-how-can-i-show-tooltip-only-when-ellipsis-is - 激活) –