Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixing disabling of Fastclick on top/bottom #12

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@ bouncefix.js [![Build Status](https://travis-ci.org/jaridmargolin/bouncefix.js.p
============

```
__ ____ _
__ ____ _
/ / ___ __ _____ _______ / _(_)_ __ (_)__
/ _ \/ _ \/ // / _ \/ __/ -_) _/ /\ \ / / (_-<
/_.__/\___/\_,_/_//_/\__/\__/_//_//_\_(_)_/ /___/
|___/
|___/
```

Stop full body elastic scroll bounce when scrolling inside nested containers (IOS)

---
Expand Down Expand Up @@ -63,7 +63,7 @@ Apply fix on all elements matching the specified className.
bouncefix.add('srcollable');
```


### bouncefix.remove(className);

Remove fix from all elements matching the specified className.
Expand Down Expand Up @@ -109,4 +109,4 @@ Permission is hereby granted, free of charge, to any person obtaining a copy of

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
10 changes: 5 additions & 5 deletions dist/amd/utils.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
* utils.js
*
*
* (C) 2014 Jarid Margolin
* MIT LICENCE
*
Expand Down Expand Up @@ -53,15 +53,15 @@ utils.scrollToEnd = function (el) {
var curPos = el.scrollTop,
height = el.offsetHeight,
scroll = el.scrollHeight;

// If at top, bump down 1px
if(curPos <= 0) {
el.scrollTop = 1;
el.fastClickLastScrollTop = el.scrollTop = 1;
}

// If at bottom, bump up 1px
if(curPos + height >= scroll) {
el.scrollTop = scroll - height - 1;
el.fastClickLastScrollTop = el.scrollTop = scroll - height - 1;
}
};

Expand All @@ -73,4 +73,4 @@ utils.scrollToEnd = function (el) {
return utils;


});
});
6 changes: 3 additions & 3 deletions dist/bouncefix.js
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ domEvent = function () {
}();
/*
* utils.js
*
*
* (C) 2014 Jarid Margolin
* MIT LICENCE
*
Expand Down Expand Up @@ -146,11 +146,11 @@ utils = function () {
var curPos = el.scrollTop, height = el.offsetHeight, scroll = el.scrollHeight;
// If at top, bump down 1px
if (curPos <= 0) {
el.scrollTop = 1;
el.fastClickLastScrollTop = el.scrollTop = 1;
}
// If at bottom, bump up 1px
if (curPos + height >= scroll) {
el.scrollTop = scroll - height - 1;
el.fastClickLastScrollTop = el.scrollTop = scroll - height - 1;
}
};
// ----------------------------------------------------------------------------
Expand Down
2 changes: 1 addition & 1 deletion dist/bouncefix.min.js

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

9 changes: 5 additions & 4 deletions dist/common/utils.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
* utils.js
*
*
* (C) 2014 Jarid Margolin
* MIT LICENCE
*
Expand Down Expand Up @@ -53,15 +53,15 @@ utils.scrollToEnd = function (el) {
var curPos = el.scrollTop,
height = el.offsetHeight,
scroll = el.scrollHeight;

// If at top, bump down 1px
if(curPos <= 0) {
el.scrollTop = 1;
el.fastClickLastScrollTop = el.scrollTop = 1;
}

// If at bottom, bump up 1px
if(curPos + height >= scroll) {
el.scrollTop = scroll - height - 1;
el.fastClickLastScrollTop = el.scrollTop = scroll - height - 1;
}
};

Expand All @@ -73,3 +73,4 @@ utils.scrollToEnd = function (el) {
module.exports = utils;



2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "bouncefix.js",
"description": "Stop full page scroll bounce on ios.",
"author": "Jarid Margolin <jaridmargolin@gmail.com>",
"version": "0.3.0",
"version": "0.3.1",
"homepage": "https://github.com/jaridmargolin/bouncefix.js",
"repository": {
"type": "git",
Expand Down
10 changes: 5 additions & 5 deletions src/utils.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
* utils.js
*
*
* (C) 2014 Jarid Margolin
* MIT LICENCE
*
Expand Down Expand Up @@ -53,15 +53,15 @@ utils.scrollToEnd = function (el) {
var curPos = el.scrollTop,
height = el.offsetHeight,
scroll = el.scrollHeight;

// If at top, bump down 1px
if(curPos <= 0) {
el.scrollTop = 1;
el.fastClickLastScrollTop = el.scrollTop = 1;
}

// If at bottom, bump up 1px
if(curPos + height >= scroll) {
el.scrollTop = scroll - height - 1;
el.fastClickLastScrollTop = el.scrollTop = scroll - height - 1;
}
};

Expand All @@ -73,4 +73,4 @@ utils.scrollToEnd = function (el) {
return utils;


});
});