Modify ↓
Ticket #11009 (closed bug: duplicate)
jQuery not considering current box model when returning current width of element.
| Reported by: | gabrycir@… | Owned by: | gabrycir@… |
|---|---|---|---|
| Priority: | low | Milestone: | None |
| Component: | dimensions | Version: | 1.7.1 |
| Keywords: | Cc: | ||
| Blocking: | Blocked by: |
Description
When using a css like this (using a different box model than the default):
#container {
padding: 12px;
box-sizing: border-box;
width: 500px;
}
when calling
$("#container").width();
I will receive 476 instead of 500, meaning it doesn't count the 24px padding.
Change History
comment:1 Changed 18 months ago by sindresorhus
- Owner set to gabrycir@…
- Status changed from new to pending
comment:2 Changed 18 months ago by jpate
looks like a duplicate of #11004 which I have mostly solved (works but doesn't deal with ie6/7 which don't support box-sizing css (they treat everything as box-sizing:border-box))
Please follow the bug reporting guidlines and use jsFiddle when providing test cases and demonstrations instead of pasting the code in the ticket.
Note: See
TracTickets for help on using
tickets.

Thanks for taking the time to contribute to the jQuery project! Please provide a complete reduced test case on jsFiddle to help us assess your ticket.
Additionally, be sure to test against the jQuery Edge version to ensure the issue still exists. To get you started, use this boilerplate: http://jsfiddle.net/FrKyN/ Open the link and click to "Fork" (in the top menu) to get started.