1.4.4 return size of hidden element, but what about element in another hidden element? Is there any better solution then getWidth?
<script type="text/javascript">
function getWidth(element){
var parent = element.parent();
$('body').append(element);
var width = element.width();
parent.append(element);
return width;
}
$(function(){
var width = $("#foo").width();
console.log(width); //0
width = getWidth($("#foo"));
console.log(width); //ok
});
</script>
<div style='display:none'>
<div style='display:none' id='foo'>bar</div>
</div>