Bug Tracker

Modify

Ticket #11009 (closed bug: duplicate)

Opened 18 months ago

Last modified 18 months ago

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

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.

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))

comment:3 Changed 18 months ago by timmywil

  • Priority changed from undecided to low
  • Resolution set to duplicate
  • Status changed from pending to closed
  • Component changed from unfiled to dimensions

comment:4 Changed 18 months ago by timmywil

Duplicate of #11004.

Please follow the  bug reporting guidlines and use  jsFiddle when providing test cases and demonstrations instead of pasting the code in the ticket.

View

Add a comment

Modify Ticket

Action
as closed
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.