Get the height/width in % using jQuery -
i dynamically resize elements using jquery.
in of cases, it's going well, call $(selector).css('height'); height/width values or $(selector).height();.
it provides me value in px, if setted in % in stylesheet.
but sometimes, returns value in %, wondering, there way sure value in px ? how "prevent" format ?
edit
i take - i'm not sure if jquery ever returns % value, if specify in css - inline or otherwise (although leave original answer intact).
can provide example of when % value returned?
original
.css() value applied directly element:
<div style="height: 75%;"> .height() get's height of element in dom - in pixels.
Comments
Post a Comment