Pull to refresh
0
0
igoru@igoru

User

Send message
Лучше заменить description.setAttribute("value",this.innerHTML); на
description.setAttribute("value",this.textContent);.
Иначе не коректно отображаются html entity.
Спасибо за статью. Просто решил окончательно разобраться с вопросом, вот и получилось решение. А про выделение как-то забыл.
<div style="border: green 1px solid">
<div class="elipses">Very long text.Very long text.Very long text.Very long text.Very long text</div>
<div class="elipses">Very long text.Very long text.Very long text.Very long text.Very long text</div>
</div>

css
div.elipses
{
-moz-binding: url(ff.xml#ellipsis);
overflow: hidden;
width: 100%;
white-space: nowrap;
text-overflow: ellipsis;
-o-text-overflow: ellipsis;
}

div.elipses description
{
width:100%;
}

ff.xml

<?xml version="1.0"?>
<bindings xmlns="http://www.mozilla.org/xbl"
xmlns:xbl="http://www.mozilla.org/xbl"
xmlns:xul="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
<binding id="ellipsis">
<implementation>
<constructor>
<![CDATA[
var description = document.createElementNS("http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul","description");
description.setAttribute("value",this.innerHTML);
this.innerHTML = '';
this.appendChild(description);
]]></constructor>
</implementation>
</binding>
</bindings>
А так пробовали?






Information

Rating
Does not participate
Registered