一款小巧的js插件,可配置的回到顶部按钮,点击自动滚动显示,自动隐藏页面滚动到顶部。调用方式const button = document.querySelector("#back2top"); BACK2TOP(button, 200);CSS样式代码button#back2top{ position: fixed; right: 2%; bottom: 2%; opacity: 0; visibility: hidden; font-size: 14px; color: #fff; background-color: #4F46E5; border: none; outline: none; cursor: pointer; padding: 10px 18px; margin: 0; border-radius: 3px; }
preview Points Download 6毛Download Share Download
未经允许不得转载: ICode联盟 » Plugin Special Effects » 网页右下角返回顶部js插件back2top