Skip to content

Commit

Permalink
Merge pull request #2 from davidkethel/patch-2
Browse files Browse the repository at this point in the history
Ensure div is at top/left when scroll bars removed
  • Loading branch information
HyeonJe, Jun committed Feb 8, 2013
2 parents b169654 + 6b2a625 commit 9025829
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/perfect-scrollbar.js
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@
else {
scrollbar_x_width = 0;
scrollbar_x_left = 0;
$this.scrollLeft(0);
}
if(container_height < content_height) {
scrollbar_y_height = parseInt(container_height * container_height / content_height);
Expand All @@ -68,6 +69,7 @@
else {
scrollbar_y_height = 0;
scrollbar_y_left = 0;
$this.scrollTop(0);
}

$scrollbar_x.css({left: scrollbar_x_left + $this.scrollLeft(), bottom: scrollbar_x_bottom - $this.scrollTop(), width: scrollbar_x_width});
Expand Down

0 comments on commit 9025829

Please sign in to comment.