#12293 closed bug (invalid)
function outerWidth doesn't work
Reported by: | 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.
Change History (9)
comment:1 follow-up: 2 Changed 10 years ago by
Component: | unfiled → dimensions |
---|---|
Priority: | undecided → low |
Resolution: | → invalid |
Status: | new → closed |
comment:2 Changed 10 years ago by
Replying to sindresorhus:
Cannot reproduce in IE6-9, Firefox 3.6 / latest, Chrome, Safari, Opera 12.
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.
comment:3 Changed 10 years ago by
Please upgrade jqueryUI to 1.8.22, as that's the one that's compatible with jQuery 1.8
comment:4 Changed 10 years ago by
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
comment:5 Changed 10 years ago by
Keywords: | needsdocs added |
---|
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.
comment:6 Changed 10 years ago by
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.
comment:7 Changed 10 years ago by
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/