Thanks for the reply, this will be for an intranet site with ie 5 or
greater. according to this:
http://joelpt.eml.cc/TextOverflowEllipsis.html it looks like I could go
down to IE 5 and only loose the ellipses, but still get the
text-overflow: hidden.
I'm not a designer, but a developer who's learning design. Here is a
javascript method... which works pretty well first try... what method
is safer, and/or better: javascript or CSS3 properties?
<script type="text/javascript">
function trimMenu(id)
{
var d = document.getElementById(id);
var spans = d.getElementsByTagName('span');
for (var i=0, len=spans.length; i<len; ++i){
addEllipsis(spans[i]);
}
}
function addEllipsis(d)
{
var x = d.parentNode.offsetWidth;
var txt = d.firstChild.data;
while (x < d.offsetWidth){
txt = txt.substring(0,txt.length-1);
d.firstChild.data = txt + '\u2026';
}
}
</script>
<!-- Style attribute wrapped for posting -->
<div id='divA')
style="border:1px solid blue; width:100px; white-space: nowrap;
overflow: hidden;">
<span>Here is some too-long text</span><br>
<span>Another bit of too-long text</span><br>
<span>Yup, too-long text</span><br>
</div>
<input type="button" value="Trim menu items"
onclick="trimMenu('divA')">
(courtesy this thread, thanks Rob
http://groups.google.com/group/comp....f5e54642377323)
Thanks!