Ecosyste.ms: Awesome

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

Awesome Lists | Featured Topics | Projects

https://github.com/seayxu/backtop

back to top component
https://github.com/seayxu/backtop

Last synced: about 7 hours ago
JSON representation

back to top component

Awesome Lists containing this project

README

        

# BackTop Web Component

This is a web component,back to top or home page.

# Usage

1. download this project dist files.

2. copy dest folder to your project.

3. import .js and .css files to web page.

``` html



```

4. add javascript code

``` javascript

BackTop.init(1,500);

```

# Sample

``` html



返回顶部组件示例



body{height: 6000px;}






BackTop.init(1,500);

```

# API

## BackTop.init(type,time);

* ### type

>scroll type,default is 0.

0:uniform speed.

1:uniform acceleration speed.

2:uniform deceleration speed.

* ### time
>scroll times,default is 500ms.

# Other

Icons : [Linearicons Free v1.0.0][4]

# License

[![CC-BY-SA][2]][1]

[CC-BY-SA 4.0][1] © [SeayXu][3]

[1]:http://creativecommons.org/licenses/by-sa/4.0/
[2]:https://i.creativecommons.org/l/by-sa/4.0/88x31.png
[3]:http://seay.me
[4]:https://linearicons.com/free