
Research
Malicious npm Packages Impersonate Flashbots SDKs, Targeting Ethereum Wallet Credentials
Four npm packages disguised as cryptographic tools steal developer credentials and send them to attacker-controlled Telegram infrastructure.
gm-back-to-top
Advanced tools
A simple back to top component.
简体中文 | English
If you like this, give me a star ⭐ plz.
If you find a bug, submit an issuse 🐛 here.
npm install gm-back-to-top -S
# Or use yarn
yarn add gm-back-to-top
Or just use <script>
tag:
<link rel="stylesheet" href="path/to/gm-back-to-top.min.css" />
<script src="path/to/gm-back-to-top.min.js"></script>
To get dist js and css files, please visit Releases Page or use CDN like jsDelivr
.
If you use import/require
:
import GmBackToTop from 'gm-back-to-top'
import 'gm-back-to-top/gm-back-to-top.min.css'
// Create an component instance with options
// or just use default options.
const instance = GmBackToTop()
If you use <script/>
tag to import, GmBackToTop
will be mounted on window
.
Don't forget to import css file.
Create a new instance with options.
options
{ object }Options feilds are showing below:
name | type | description | default |
---|---|---|---|
duration | number | Duration from current place to top, unit is ms | 1 * 1000 |
container | * | Container element of Scrollable area | window |
visibilityHeight | number | Show component when scroll distance is more than this value | 500 |
done | function | A callback exec when back to top | () => {} |
children | string | HTMLElement | Content of back to top button | 'back' |
It will return a component instance, the relationship between them is:
instance.__proto__ = GmBackToTop.prototype
So that instance could use all of prototype methods on GmBackToTop
.
Instance will have those properties:
GmBackToTop {
duration,
container,
visibilityHeight,
done,
children,
id, // instance id
ele // button component element
}
Don't rewrite atrrbuties on instance directly, you should call
GmBackToTop.prototype.setOptions()
to do that.
Get if component is showing.
return
{ boolean }Return ture
if it's showing, false
if not.
Display the component.
return
{ GmBackToTop }Return component instance itself.
Hide the component.
return
{ GmBackToTop }Return component instance itself.
Trigger click of button.
return
{ GmBackToTop }Return component instance itself.
Set options for component.
options
{ object }Options for component instance.
return
{ GmBackToTop }Return the instance itself.
MIT
FAQs
A simple back to top component
The npm package gm-back-to-top receives a total of 0 weekly downloads. As such, gm-back-to-top popularity was classified as not popular.
We found that gm-back-to-top demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
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.
Research
Four npm packages disguised as cryptographic tools steal developer credentials and send them to attacker-controlled Telegram infrastructure.
Security News
Ruby maintainers from Bundler and rbenv teams are building rv to bring Python uv's speed and unified tooling approach to Ruby development.
Security News
Following last week’s supply chain attack, Nx published findings on the GitHub Actions exploit and moved npm publishing to Trusted Publishers.