One of options can be too, that parent element is not visible.
Here is example: http://jsfiddle.net/nDMM3/
You can see, that jQuery return width = 100 (like 100%)
.test {
border: 1px solid;
cursor: pointer;
height: 10px;
position: relative;
width: 100%;
display:none;
}
#test2{
width:100%;
}
<div id="test1" class="test">
<div id="test2">
Hello
</div>
</div>
alert($('#test2').width());
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…