As per jQuery docs the innerWidth
method is the one that includes padding (https://api.jquery.com/innerWidth/), while the previously used outerWidth
includes border width as well (https://api.jquery.com/outerWidth/). Therefore the use of innerWidth
makes more sense for getting the container width with padding in the code (plus a setting name includePadding
suggest only padding width is taken into account as an extra for container width determination and might be confusing otherwise). The same goes to innerHeight
vs outerHeight
.
This commit is contained in:
parent
84360fb730
commit
32718ae9cc
@ -152,8 +152,8 @@
|
||||
};
|
||||
|
||||
var updateBarSizeAndPosition = function () {
|
||||
containerWidth = settings.includePadding ? $this.outerWidth() : $this.width();
|
||||
containerHeight = settings.includePadding ? $this.outerHeight() : $this.height();
|
||||
containerWidth = settings.includePadding ? $this.innerWidth() : $this.width();
|
||||
containerHeight = settings.includePadding ? $this.innerHeight() : $this.height();
|
||||
contentWidth = $this.prop('scrollWidth');
|
||||
contentHeight = $this.prop('scrollHeight');
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user