1.0.4 • Published 3 years ago

remove-ios-bounce v1.0.4

Weekly downloads
6
License
ISC
Repository
github
Last release
3 years ago

remove-ios-bounce

Remove iOS bounce by Touch evnet listener and settting scrollTop&scrollLeft attributes.

Installing

Using npm:

$ npm install remove-ios-bounce

Using CDN in bower:

<script src="https://cdn.jsdelivr.net/npm/remove-ios-bounce/lib/remove-bounce.min.js"></script>

Example

remove bounce effects on body:

import {removeBodyBounce} from 'remove-ios-bounce';

removeBodyBounce();

remove bounce effects on other elements:

import {RemoveBounce} from 'remove-ios-bounce';

/**
 * new RemoveBounce(containerElement, onlyIOS)
 * @param:containerElement, required
 * @param:onlyIOS, Boolean, not required(defalut false). TRUE means the function will work on iOS only.
 **/

// After the containerElement is rendered, perform initialization.
const bounceCtrl = new RemoveBounce(document.getElementById('container'));

// Before the containerElement is removed, clear event listener by destory function.
bounceCtrl.destory();
1.0.4

3 years ago

1.0.3

3 years ago

1.0.2

3 years ago

1.0.1

3 years ago

1.0.0

3 years ago