Ecosyste.ms: Awesome

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

Awesome Lists | Featured Topics | Projects

https://github.com/tanrax/simplescrollup

Simple plugin in Javascript to animate scrolling when you return to the top of the page
https://github.com/tanrax/simplescrollup

animated javascript plugin scrolling scrollup vanilla

Last synced: about 2 months ago
JSON representation

Simple plugin in Javascript to animate scrolling when you return to the top of the page

Awesome Lists containing this project

README

        

# Simple plugin in Javascript Vanilla to animate scrolling when you return to the top of the page

## Demo

[Project Site](http://simplescrollup.programadorwebvalencia.com/)

## Download

```bash
npm install simplescrollup
```

or

```bash
yarn add simplescrollup
```

## Quick start

1. Download **simplescrollup.js** .

2. Link in your HTML **simplescrollup.js** .

```html

```

Example

```html






```

3. Add your button with this structure.

```html
Your text
```

Example

```html





Your text

```

4. Add CSS.

```css
.simplescrollup__button {
position: fixed;
bottom: 3rem;
right: 3rem;
transition: 1s all;
z-index: 10000;
}
.simplescrollup__button--show {
transform: translateX(0);
}
.simplescrollup__button--hide {
transform: translateX(100px);
}
```

Example

```html



.simplescrollup__button {
position: fixed;
bottom: 3rem;
right: 3rem;
transition: 1s all;
z-index: 10000;
}
.simplescrollup__button--show {
transform: translateX(0);
}
.simplescrollup__button--hide {
transform: translateX(100px);
}




Your text

```

5. Enjoy!!

## Advance

You can control the duration and type of animation.

```html
Your text
```

* **duration**: Time in milliseconds that it will take to go up above the page.
* **height-hide**: Distance in pixels from top at which button will be displayed.
* **easing**: You can change the animation scroll for any of this list.
* linear
* easeInQuad
* easeOutQuad
* easeInOutQuad
* easeInCubic
* easeOutCubic
* easeInOutCubic
* easeInQuart
* easeOutQuart
* easeInOutQuart
* easeInQuint
* easeOutQuint
* easeInOutQuint