That is exactly what I was first talking about. In FF the offsetWidth of the nobr tag must be queried:
Code:
thelength=dataobj.offsetWidth;
queries the span tag. This may work in FF:
Code:
thelength=dataobj.firstChild.offsetWidth;
However, due to the way that child nodes are reckoned in FF it may not get it. So, a function may need to be used:
Code:
function findNobr(obj){
if (typeof obj.tagName=='undefined'||obj.tagName.toLowerCase()!=='nobr') {
returnobj=obj.firstChild
while (typeof returnobj.tagName=='undefined'||returnobj.tagName.toLowerCase()!=='nobr')
returnobj=returnobj.nextSibling
return returnobj
}
else
return obj
}
With that function available, this will get the nobr's offsetWidth, as long as the nobr tag hasn't been left out of the markup by mistake:
Code:
thelength=findNobr(dataobj).offsetWidth;
Bookmarks