Side navigation
#12293 closed bug (invalid)
Opened August 14, 2012 12:19PM UTC
Closed August 14, 2012 12:43PM UTC
Last modified August 16, 2012 02:34PM UTC
function outerWidth doesn't work
Reported by: | jquery@shark.kom.cz | Owned by: | |
---|---|---|---|
Priority: | low | Milestone: | None |
Component: | dimensions | Version: | 1.8.0 |
Keywords: | Cc: | ||
Blocked by: | Blocking: |
Description
In version 1.8.0 $('li#id').outerWidth() returns DOM object instead of integer.
Attachments (0)
Change History (9)
Changed August 14, 2012 12:43PM UTC by comment:1
component: | unfiled → dimensions |
---|---|
priority: | undecided → low |
resolution: | → invalid |
status: | new → closed |
Changed August 14, 2012 01:05PM UTC by comment:2
Replying to [comment:1 sindresorhus]:
Cannot reproduce in IE6-9, Firefox 3.6 / latest, Chrome, Safari, Opera 12. http://jsfiddle.net/mofle/FhrPT/
Well it doesn't work with jquery-ui-1.8.20/ui/minified/jquery.ui.core.min.js but it works with jquery-ui-1.8.22/ui/minified/jquery.ui.core.min.js.
Changed August 14, 2012 01:31PM UTC by comment:3
Please upgrade jqueryUI to 1.8.22, as that's the one that's compatible with jQuery 1.8
Changed August 16, 2012 01:56AM UTC by comment:4
From my analysis
In 1.7.2, any truthy value passed to outerWidth would be considered include margin true.
In 1.8.0, only true boolean is considered include margin true
Changed August 16, 2012 02:22AM UTC by comment:5
keywords: | → needsdocs |
---|
That's because in 1.8, the dimension functions are now setters too, and not just getters! You can do
$(elem).outerWidth(50);
And automatically set content+padding+border to 50! Or you can do:
$(elem).outerWidth(50, true);
And automatically set content+padding+border+margin to 50! Awesome, right?
Needs docs.
Changed August 16, 2012 06:39AM UTC by comment:6
yes, that's awesome but VERY DANGEROUS change! a lot of code uses outerWidth() as getter. Now, everything's broken. Everybody needs a search-replace their code if they want to upgrade to 1.8.0. It's not a safe change for javascript code which has no compiler to make this change revealed.
Changed August 16, 2012 12:33PM UTC by comment:7
No problems. outerWidth() continues to work as a getter. Before, it accepted either no arguments or a single Boolean argument. If you were passing it something else, you were doing it wrong, which is VERY DANGEROUS because it could break when the API is updated.
Cannot reproduce in IE6-9, Firefox 3.6 / latest, Chrome, Safari, Opera 12.
http://jsfiddle.net/mofle/FhrPT/