If I alert
the element which has a css selector set to width:100%
I get it's with in px
, is there some way to get it in %
as set from css, I need it to fix some script with fluid layouts.
// css
.my-element {
width:100%;
}
// javascript
alert('width: '+$('.my-element').css('width'));
// this alerts "width: 1116px" instead of "width: 100%"
Maybe something like this is always true?
alert($('.my-element').outerWidth() == $('.my-element').parent().outerWidth());