New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

backtop

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

backtop

web back to top component

latest
Source
npmnpm
Version
1.0.1
Version published
Maintainers
1
Created
Source

BackTop Web Component

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

Usage

  • download this project dist files.

  • copy dest folder to your project.

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

<link rel="stylesheet" href="./style/linearicons-free.min.css">
<link rel="stylesheet" href="./style/backtop.min.css">
<script type="text/javascript" src="./js/backtop.min.js"></script>
  • add javascript code
<script type="text/javascript">
  BackTop.init(1,500);
</script>

Sample

<!DOCTYPE html>
<html>
  <head>
    <meta charset="utf-8">
    <title>返回顶部组件示例</title>
    <link rel="stylesheet" href="./style/linearicons-free.min.css">
    <link rel="stylesheet" href="./style/backtop.min.css">
    <style type="text/css">
    	body{height: 6000px;}
    </style>
  </head>
  <body>
  </body>
  <script type="text/javascript" src="./js/backtop.min.js"></script>
  <script type="text/javascript">
    BackTop.init(1,500);
  </script>
</html>

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

License

CC-BY-SA

CC-BY-SA 4.0 © SeayXu

Keywords

backtop

FAQs

Package last updated on 13 Oct 2016

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts