Socket
Socket
Sign inDemoInstall

vanilla-back-to-top

Package Overview
Dependencies
Maintainers
1
Versions
59
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

vanilla-back-to-top - npm Package Compare versions

Comparing version 3.2.3 to 4.0.0

dist/vanilla-back-to-top.umd.min.js

15

package.json
{
"name": "vanilla-back-to-top",
"version": "3.2.3",
"version": "4.0.0",
"description": "Configurable zero dependency Back To Top button",
"main": "dist/vanilla-back-to-top.min.js",
"main": "dist/vanilla-back-to-top.umd.min.js",
"repository": {

@@ -12,10 +12,15 @@ "type": "git",

"up",
"back to top",
"back",
"top",
"button",
"link",
"scroll",
"pure",
"zero dependency",
"vanillajs",
"vanilla",
"configurable",
"prerendered",
"blog",
"prerendered",
"static",
"website",
"jekyll",

@@ -22,0 +27,0 @@ "hugo",

@@ -5,3 +5,3 @@ # Vanilla Back To Top

Ideal for pre-rendered blogs with no frameworks, e.g., [Jekyll](https://jekyllrb.com), [Hugo](http://gohugo.io/) or [Hexo](https://hexo.io/).
Ideal for pre-rendered static websites with no frameworks, e.g., [Jekyll](https://jekyllrb.com), [Hugo](http://gohugo.io/) or [Hexo](https://hexo.io/).

@@ -13,7 +13,23 @@ <img src="http://i.pi.gy/DoaQa.gif" width="300px"/>

Add this to your HTML:
```html
<script src="https://unpkg.com/vanilla-back-to-top@4.0.0/dist/vanilla-back-to-top.min.js"></script>
<script>addBackToTop({})</script>
```
<script src="https://unpkg.com/vanilla-back-to-top@3.2.3/dist/vanilla-back-to-top.min.js"></script>
If you don't want to rely on [unpkg.com](https://unpkg.com/#/about), save [the file](https://unpkg.com/vanilla-back-to-top@4.0.0/dist/vanilla-back-to-top.min.js) to your project and serve it from your server:
```html
<script src="/assets/vanilla-back-to-top.min.js"></script>
<script>addBackToTop({})</script>
```
There's also a [UMD](https://github.com/vfeskov/vanilla-back-to-top/blob/master/scripts/umd-template.js) [build](https://github.com/vfeskov/vanilla-back-to-top/blob/master/dist/vanilla-back-to-top.umd.min.js) available so you could import it in your asset pipepline:
```bash
npm install --save vanilla-back-to-top
```
```js
import { addBackToTop } from 'vanilla-back-to-top'
addBackToTop({})
// your vue/react/angular/etc bootstrapping code here
```
Optionally customise CSS of the button using `#back-to-top` selector, e.g.:

@@ -20,0 +36,0 @@ ```

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc