https://github.com/athm-fe/gotop
https://github.com/athm-fe/gotop
gotop jquery-plugin
Last synced: 11 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/athm-fe/gotop
- Owner: athm-fe
- License: mit
- Created: 2018-04-19T11:33:20.000Z (about 8 years ago)
- Default Branch: master
- Last Pushed: 2018-04-19T11:35:39.000Z (about 8 years ago)
- Last Synced: 2025-02-01T08:46:37.726Z (over 1 year ago)
- Topics: gotop, jquery-plugin
- Language: JavaScript
- Homepage: https://athm-fe.github.io/gotop/
- Size: 5.86 KB
- Stars: 0
- Watchers: 4
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
Awesome Lists containing this project
README
# Gotop
该插件只做两件事:
1. 当滚动超出一屏时,显示返顶按钮;否则,隐藏按钮
2. 点击返顶按钮时,滚动到页面顶部
请自行使用样式来给返顶按钮定位。
## Usage
和其他控件类似,通过 `data-toggle="gotop"` 或者 JavaScript 都可以初始化返回顶部控件。
```html
返回顶部
```
或者
```javascript
$('.js-gotop').gotop();
```
## Options
无
## Methods
### `.gotop()`
初始化
```javascript
$('.js-gotop').gotop();
```
## Events
Event Type | Description
---------- | -----------
show.fe.gotop | 返回顶部按钮显示的时候触发。
hide.fe.gotop | 返回顶部按钮隐藏的时候触发。
```javascript
$('.js-gotop').on('show.fe.gotop', function () {
// do something...
});
```
# End
Thanks to [Bootstrap](http://getbootstrap.com/)