An open API service indexing awesome lists of open source software.

https://github.com/statickidz/tiltscroll

Script to scroll webpage to top on device tilt
https://github.com/statickidz/tiltscroll

Last synced: 5 months ago
JSON representation

Script to scroll webpage to top on device tilt

Awesome Lists containing this project

README

          

# TiltScroll #

![TiltScroll Example](http://img.imgur.com/YHFtRkC.gif "")

TiltScroll is a simple, easy-to-use JavaScript library to make your website sensitive event tilting the device and automatically move up.

TiltScroll is developed by [StaticKidz](https://statickidz.com/).

## Compatibility ##

I tried and tested on the following mobile browsers and devices:

* Mobile Safari on iOS 8
* Chrome on iOS 8
* Chrome on Android (ICS)
* MacBook (Early 2011) and Chrome

## Usage ##

Include tiltscroll.js in your JavaScript bundle or add it to your HTML page like this:

```html

```

TiltScroll instantiates automatically, don't worry fot that. In addition, you can override default options.

## Options ##

Change the tilt sensitivity that makes the scroll, by default -15, the posible values its 0 to -180.

```js
TiltScroll({
deviceSense: -30
});
```

Or change the scroll duration time in miliseconds:

```js
TiltScroll({
scrollDuration: 5500
});
```

## Live Demo ##

You can test this working [here](https://statickidz.com).

## Credits and collaboration ##

TiltScroll is maintained by [Adrián Barrio Andrés](https://statickidz.com) and the original idea was for [Eduardo Matias](https://twitter.com/Madwardan). All open source code released by StaticKidz is licenced under the MIT licence.