I am wondering it there is a way to detect if text-overflow:ellipsis
is active on an input field so i can show a tooltip with the full text.
Css:
input[type='text']
{
text-overflow:ellipsis;
}
Html:
<input type="text" onmouseover="Tooltip.Show(this)" value="some long text" />
Javascript:
Tooltip.Show = function (input)
{
// This is where i need the see if the current input show ellipsis.
if ($(input).isEllipsisActive())
{
// Show the tooltip
}
}
BR
Andreas
Please note, this question is about input
element. A normal HTML element (e.g., div
) also has to have
white-space: nowrap;
overflow: hidden;
for text-overflow: ellipsis;
to apply. (Overflow
can also be scroll
or auto
.) See this link for more information.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…