overflow : hidden;<br> text-overflow : ellipsis;<br> -o-text-overflow : ellipsis;
<? xml version ="1.0" ? > <br> < bindings xmlns ="http://www.mozilla.org/xbl" xmlns:xul ="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul" > <br><br> < binding id ="none" > <br> < content >< children /></ content > <br> </ binding > <br><br> < binding id ="ellipsis" > <br> < content > <br> < xul:label crop ="end" >< children /></ xul:label > <br> </ content > <br> < implementation > <br> < field name ="label" > document.getAnonymousNodes( this )[ 0 ] </ field > <br> < field name ="style" > this.label.style </ field > <br> < property name ="display" > <br> < getter > this.style.display </ getter > <br> < setter > if( this.style.display != val ) this.style.display= val </ setter > <br> </ property > <br> < property name ="value" > <br> < getter > this.label.value </ getter > <br> < setter > if( this.label.value != val ) this.label.value= val </ setter > <br> </ property > <br> < method name ="update" > <br> < body > <br> var strings= this.textContent.split( /\s+/g )<br> if( !strings[ 0 ] ) strings.shift()<br> if( !strings[ strings.length - 1 ] ) strings.pop()<br> this.value= strings.join( ' ' )<br> this.display= strings.length ? '' : 'none'<br> </ body > <br> </ method > <br> < constructor > this.update() </ constructor > <br> </ implementation > <br> < handlers > <br> < handler event ="DOMSubtreeModified" > this.update() </ handler > <br> </ handlers > <br> </ binding > <br><br> </ bindings >
-moz-bindin g: url( 'bindings.xml#ellipsis' );
-moz-binding : url( 'bindings.xml#none' );
.v-ellip, v\:ellip {<br> text-overflow : ellipsis;<br> -o-text-overflow : ellipsis;<br> -moz-binding : url( 'bindings.xml#ellipsis' );<br> white-space : nowrap;<br> overflow : hidden;<br> display : inline-block;<br> max-width : 100%;<br>}
< body xmlns:v ="urn:markup:visual" > <br><br> < p > <br> < a href ="#" >< v:ellip ><! -- :- -- ></ v:ellip ></ a > <br> </ p > <br> <br> < p > <br> < a href ="#" class ="v-ellip" > - </ a > <br> </ p > <br> <br> < p >< v:ellip > <br> <br> <br> </ v:ellip ></ p > <br><br> </ body >
Source: https://habr.com/ru/post/91500/
All Articles