Skip to content

Commit

Permalink
Scroll boundry fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Jonathan Azoff committed Jul 15, 2011
1 parent e1b57f7 commit 81d8d48
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 32 deletions.
1 change: 1 addition & 0 deletions README.md
Expand Up @@ -76,6 +76,7 @@ Change Log
+ <https://github.com/azoff/Overscroll/issues/23>
- Added click insulation on drag events
+ <https://github.com/azoff/Overscroll/issues/22>
- Fixed bug when calculating container scrollWidth/Height (thanks Riccardo "Rial" Re)
* __1.4.5__
- Changed compiler to uglifyjs
+ <https://github.com/mishoo/UglifyJS>
Expand Down
22 changes: 5 additions & 17 deletions jquery.overscroll.js
Expand Up @@ -69,8 +69,7 @@
wheelDelta: 20,
scrollDelta: 15,
thumbThickness: 8,
thumbOpacity: 0.7,
boundingBox: 1000000
thumbOpacity: 0.7
},

checkIosDevice: function () {
Expand Down Expand Up @@ -434,24 +433,15 @@
// gets sizing for the container and thumbs
getSizing: function (container) {

var

old = {
left: container.scrollLeft(),
top: container.scrollTop()
},

sizing = {};
var sizing = {}, parent = container.get(0);

sizing.container = {
width: container.width(),
height: container.height()
};
};

container.scrollLeft(o.constants.boundingBox).scrollTop(o.constants.boundingBox);
sizing.container.scrollWidth = container.scrollLeft();
sizing.container.scrollHeight = container.scrollTop();
container.scrollTop(0).scrollLeft(0);
sizing.container.scrollWidth = (parent.scrollWidth == sizing.container.width ? 0 : parent.scrollWidth);
sizing.container.scrollHeight = (parent.scrollHeight == sizing.container.height ? 0 : parent.scrollHeight);

sizing.thumbs = {
horizontal: {
Expand All @@ -473,8 +463,6 @@
sizing.container.width -= sizing.thumbs.horizontal.width;
sizing.container.height -= sizing.thumbs.vertical.height;

container.scrollTop(old.top).scrollLeft(old.left);

return sizing;

},
Expand Down
30 changes: 15 additions & 15 deletions jquery.overscroll.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 81d8d48

Please sign in to comment.