Merge pull request #36 from zenozeng/master
Use prop('scrollWidth') and prop('scrollHeight') instead of outerWidth() and outerHeight() to get the content size.
This commit is contained in:
commit
a8db04e41d
@ -70,8 +70,8 @@
|
|||||||
var updateBarSizeAndPosition = function () {
|
var updateBarSizeAndPosition = function () {
|
||||||
containerWidth = $this.width();
|
containerWidth = $this.width();
|
||||||
containerHeight = $this.height();
|
containerHeight = $this.height();
|
||||||
contentWidth = $content.outerWidth(false);
|
contentWidth = $this.prop('scrollWidth');
|
||||||
contentHeight = $content.outerHeight(false);
|
contentHeight = $this.prop('scrollHeight');
|
||||||
if (containerWidth < contentWidth) {
|
if (containerWidth < contentWidth) {
|
||||||
scrollbarXWidth = parseInt(containerWidth * containerWidth / contentWidth, 10);
|
scrollbarXWidth = parseInt(containerWidth * containerWidth / contentWidth, 10);
|
||||||
scrollbarXLeft = parseInt($this.scrollLeft() * containerWidth / contentWidth, 10);
|
scrollbarXLeft = parseInt($this.scrollLeft() * containerWidth / contentWidth, 10);
|
||||||
|
Loading…
Reference in New Issue
Block a user