https://github.com/ecto/ripstop
Prevent pages on iOS Safari from ripping when using -webkit-overflow-scroll
https://github.com/ecto/ripstop
Last synced: over 1 year ago
JSON representation
Prevent pages on iOS Safari from ripping when using -webkit-overflow-scroll
- Host: GitHub
- URL: https://github.com/ecto/ripstop
- Owner: ecto
- Created: 2012-02-18T01:36:30.000Z (over 14 years ago)
- Default Branch: master
- Last Pushed: 2012-02-18T03:02:04.000Z (over 14 years ago)
- Last Synced: 2025-02-26T18:11:59.806Z (over 1 year ago)
- Language: JavaScript
- Homepage:
- Size: 96.7 KB
- Stars: 4
- Watchers: 3
- Forks: 2
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
#Ripstop
`-webkit-overflow-scrolling: touch` is awesome. Ripstop makes it more awesome.
### Before Ripstop
When pulling down or up when child is already at edge,
_the page will rip from browser chrome and reveal linen._
### After Ripstop
When pulling down or up when child is already at edge,
_the child will rip from the parent, revealing the parent._
##usage
Pull in Ripstop:
````html
````
With pure JS:
````javascript
window.onload = function () {
ripstop(
document.getElementById('wrapper')
);
}
````
With jQuery:
````javascript
$(document).ready(function(){
$('#wrapper').ripstop();
});
````
Ripstop should be applied to a block wrapper element with one larger child.
The wrapper must have the following style:
````css
#wrapper {
overflow: scroll;
-webkit-overflow-scrolling: touch;
}
````
Ripstop will take over the child element's `ontouchstart` event. If you need it for anything,
you will have to rip out the necessary logic from Ripstop.
##license
(The MIT License)
Copyright (c) 2011 Cam Pedersen
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the 'Software'), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
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.