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:
parent
0099bb556c
commit
627b6a6b81
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user