Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/ankitjain28may/autoscroll.js
autoscroll.js is a 1 KB Javascript file based on Jquery which is used to scroll your content smoothly and automatically.
https://github.com/ankitjain28may/autoscroll.js
Last synced: 7 days ago
JSON representation
autoscroll.js is a 1 KB Javascript file based on Jquery which is used to scroll your content smoothly and automatically.
- Host: GitHub
- URL: https://github.com/ankitjain28may/autoscroll.js
- Owner: ankitjain28may
- License: mit
- Created: 2016-09-10T10:35:41.000Z (about 8 years ago)
- Default Branch: master
- Last Pushed: 2019-10-01T10:36:19.000Z (about 5 years ago)
- Last Synced: 2024-11-10T15:07:36.897Z (10 days ago)
- Language: HTML
- Homepage: http://autoscroll.surge.sh/
- Size: 19.5 KB
- Stars: 7
- Watchers: 3
- Forks: 10
- Open Issues: 8
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
[![Codacy Badge](https://api.codacy.com/project/badge/Grade/fb11e2e1d7554469853708d897a49dae)](https://www.codacy.com/app/ankitjain28may77/autoscroll-js?utm_source=github.com&utm_medium=referral&utm_content=ankitjain28may/autoscroll.js&utm_campaign=Badge_Grade)
[![npm](https://img.shields.io/npm/dt/autoscroll.js.svg)](https://www.npmjs.com/package/autoscroll.js)
[![Gitter](https://badges.gitter.im/ankitjain28may/autoscroll.js.svg)](https://gitter.im/ankitjain28may/autoscroll.js?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge)# autoscroll.js
>Auto Scroll is a Jquery plugin which is used to auto-scroll your content smoothly .
It is less than 1KB when minified.## How To use Auto Scroll
It is very easy to install, just copy and paste the autoscroll.js in your js root folder and then initialize its path
in your html file. It's better to initialize it in head tag.
```
```
_** Dependency : It depends on jquery. So initialize jquery before autoscroll.js**_# Download autoscroll.js
## Using npm```
npm install autoscroll.js
```## Install using bower
```
bower install autoscroll.js
```# General Notes
## Initialize
### With jQuery```js
$('element').scroller();
```### With vanilla JavaScript
```js
var scroll = new Scroller('{"element" : element }');
```### With HTML
Add a `data-config` attribute to your element and a class `scroller`. Options can be set in JSON in the value.``` html
...
```
Note: element can be id or class or any html tag## Default options
```
{"amount" : 100 , "delay" : 2000 } //2000ms and 100px
```## Add your options
```
{"amount" : 200 , "delay" : 1500 }
```# Example
for a div tag having id named "id-1"
```
```
you can initialize it like this
```
$("#id-1").scroller('{"amount" : 150, "delay" : 1500 }');
```
OR
```
var scroll = new Scroller('{"element" : "#id-1", "amount" : 150, "delay" : 1500 }');
```
ORBy using HTML
``` html
...
```
# License
Copyright (c) 2016 Ankit Jain - Released under the MIT LicenseRun this script in your browser...
Enjoy Cheers !!