#11051 closed bug (duplicate)
.width() and css('width') report percentages incorrectly
Reported by: | Owned by: | ||
---|---|---|---|
Priority: | undecided | Milestone: | None |
Component: | unfiled | Version: | 1.7.1 |
Keywords: | Cc: | ||
Blocked by: | Blocking: |
Description
Hi,
If you have a image:
<div id="myDiv">
<img src="1.jpg" />
</div>
And a css rule:
#myDiv img {width:100%}
And then use jQuery:
console.log($("#myDiv img",this).css("width"));
console.log($("#myDivimg",this).width());
The result IN FIREFOX (4 and 8) is:
100px
100
In the first case, 100px is obviously wrong. It should be 100%. In the second case, 100 is ambiguous.
In INTERNET EXPLORER, the result is:
undefined
null
In both cases, it would be helpful if it reported 100%. But, at least it doesn't incorrectly report 100px.
Thanks.
Trevor Moore trevor@…
Change History (2)
comment:1 Changed 12 years ago by
Resolution: | → duplicate |
---|---|
Status: | new → closed |
comment:2 Changed 12 years ago by
Note: See
TracTickets for help on using
tickets.
Duplicate of #10782.