1 Star 9 Fork 1

KiKi / docsify-scroll-to-top

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
贡献代码
同步代码
取消
提示: 由于 Git 不支持空文件夾,创建文件夹后会生成空的 .keep 文件
Loading...
README
MIT

DocsifyScrollToTop

基于Docsify的页面滚动回顶部的插件

效果图

特性

  • 🎉 支持自动显示隐藏,靠近顶部时则隐藏按钮
  • 🎉 支持平滑滚动,不依赖jquery等别的插件
  • 🎉 支持修改文本
  • 🎉 支持调整位置

使用

  1. 在 index.html 中引入脚本
<script src="//unpkg.com/docsify-scroll-to-top/dist/docsify-scroll-to-top.min.js"></script>
  1. 配置插件(可选)
window.$docsify = {
    // ...
    scrollToTop: {
        auto: true,
        text: 'Top',
        right: 15,
        bottom: 15,
        offset: 500
    }
};

配置项

scrollToTop.auto

  • 默认: true
  • 类型: Boolean
  • 描述: 是否自动隐藏按钮

scrollToTop.text

  • 默认: Top
  • 类型: String
  • 描述: 按钮文字

scrollToTop.right

  • 默认: 15
  • 类型: Number
  • 描述: 按钮距离窗口右侧距离

scrollToTop.bottom

  • 默认: 15
  • 类型: Number
  • 描述: 按钮距离窗口底部距离

scrollToTop.offset

  • 默认: 500
  • 类型: Number
  • 描述: 页面滚动多少距离后显示按钮,当auto配置为true时才有效果

相关链接

Docsify

LICENSE

MIT

The MIT License (MIT) Copyright (c) 2019-present () Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

简介

基于Docsify的页面滚动回顶部的插件 展开 收起
JavaScript
MIT
取消

发行版

暂无发行版

贡献者

全部

近期动态

加载更多
不能加载更多了
JavaScript
1
https://gitee.com/zhengxiangqi/docsify-scroll-to-top.git
git@gitee.com:zhengxiangqi/docsify-scroll-to-top.git
zhengxiangqi
docsify-scroll-to-top
docsify-scroll-to-top
master

搜索帮助