Skip to content

Commit

Permalink
Fixing document-size bug
Browse files Browse the repository at this point in the history
  • Loading branch information
ameesme committed Apr 18, 2016
1 parent bd3a7ed commit bf92aca
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 12 deletions.
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,15 @@ Smoothly scroll to positions on your website, under 350 bytes, no dependencies.

## Two versions
### [SlimScroller Base](https://github.com/ameesme/SlimScroller.js/blob/master/dist/slimScroller.min.js)
339 bytes gzipped
564 bytes uncompressed
343 bytes gzipped
580 bytes uncompressed

The base version includes support for one type of scroll-target:
- CSS selector ( eg. `slimScroller.scroll("p:first-of-type")` )

### [SlimScroller Full](https://github.com/ameesme/SlimScroller.js/blob/master/dist/slimScroller.full.min.js)
565 bytes gzipped
1010 bytes uncompressed
570 bytes gzipped
1030 bytes uncompressed
The full version includes support for three types of scroll-targets:
- Position in pixels ( eg. `slimScroller.scroll(200)` )
- CSS selector ( eg. `slimScroller.scroll("p:first-of-type")` )
Expand Down
3 changes: 2 additions & 1 deletion dist/slimScroller.full.min.js

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

4 changes: 2 additions & 2 deletions dist/slimScroller.min.js

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

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "slimscroller",
"version": "2.0.3",
"version": "2.0.4",
"description": "Slim smooth-scrolling under 350 bytes (gzipped), with no other dependencies.",
"main": "dist/slimScroller.full.min.js",
"author": "Mees Boeijen <[email protected]> (https://amees.me)",
Expand Down
4 changes: 2 additions & 2 deletions src/slimScroller.full.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ var slimScroller = function (){
horizontal = horizontal || false;
callback = callbackFunction || false;
startPosition = (horizontal) ? window.pageXOffset : window.pageYOffset;
total = (horizontal) ? window.innerWidth : window.innerHeight;
total = (horizontal) ? document.body.scrollWidth : document.body.scrollHeight;
targetPosition = (parsePosition(target) > total) ? total : parsePosition(target);

clock = Date.now();
Expand Down Expand Up @@ -78,4 +78,4 @@ var slimScroller = function (){
scroll: scroll,
bind: bind
};
}();
}();
4 changes: 2 additions & 2 deletions src/slimScroller.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ var slimScroller = function (){
horizontal = horizontal || false;
callback = callbackFunction || false;
startPosition = (horizontal) ? window.pageXOffset : window.pageYOffset;
total = (horizontal) ? window.innerWidth : window.innerHeight;
total = (horizontal) ? document.body.scrollWidth : document.body.scrollHeight;
elementPosition =(horizontal) ? document.querySelector(target).offsetLeft : document.querySelector(target).offsetTop;
targetPosition = (elementPosition > total) ? total : elementPosition;

Expand Down Expand Up @@ -42,4 +42,4 @@ var slimScroller = function (){
return {
scroll: scroll
};
}();
}();

0 comments on commit bf92aca

Please sign in to comment.