Take into account padding and margins on content

Changed the height and widths calculations of the content div to
include any padding and/or margins.

outerHeight(true) is changed to outerHeight(false).
outerWidth is changed as same.
Fixed by noraesae.
This commit is contained in:
David 2013-02-09 15:17:42 +10:00 committed by Hyunje Alex Jun
parent 0099bb556c
commit 627b6a6b81

View File

@ -51,8 +51,8 @@
var updateBarSizeAndPosition = function() {
container_width = $this.width();
container_height = $this.height();
content_width = $content.width();
content_height = $content.height();
content_width = $content.outerWidth(false);
content_height = $content.outerHeight(false);
if(container_width < content_width) {
scrollbar_x_width = parseInt(container_width * container_width / content_width);
scrollbar_x_left = parseInt($this.scrollLeft() * container_width / content_width);