查看: 172|回复: 1

一款漂亮的 滚动条 New

[复制链接]

96

主题

301

回帖

470

积分

中级会员

积分
470
发表于 2024-2-23 11:27:24 | 显示全部楼层 |阅读模式

马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。

您需要 登录 才可以下载或查看,没有账号?立即注册

x
d1.png


1 路径 找到 /template/你的模板/common/header.html   

  1. 在找到这段代码 :<font color="#708090"><body id="nv_{$_G[basescript]}" class="pg_{CURMODULE}{if $_G['basescript'] === 'portal' && CURMODULE === 'list' && !empty($cat)} {$cat['bodycss']}{/if}" onkeydown="if(event.keyCode==27) return false;">        <div id="append_parent"></div><div id="ajaxwaitid"></div></font>
复制代码
把下面代码 添加到上<body> 之间 </body>
  1. <div id="progressbar"></div><div id="scrollpath"></div>
复制代码
2  路径  找到 /template/你的模板/common/footer.html  


添加到里面 footer.html  里面


  1. <script type="text/javascript">        let progress=document.getElementById('progressbar');        let totalheight=document.body.scrollHeight - window.innerHeight;        window.onscroll=function(){                let progressHeight=(window.pageYOffset / totalheight) *100;                progress.style.height=progressHeight + "%";        }</script>
复制代码
3 路径 找到 /template/你的模板/common/common.css  


   添加到  common.css  最下面

  1. *{        -margin: 0;        -padding: 0;        -box-sizing: border-box;    font-family: "Droid Serif","Times New Roman","PingFang SC","Hiragino Sans GB","Source Han Sans CN","WenQuanYi Micro Hei","Microsoft Yahei",serif;}section{    -padding: 50px;    -background: #000;    -min-height: 100vh;}section h2{    font-size: 2.5em;    color: #fff;}section p{    font-size: 1.2em;    color: #fff;}::-webkit-scrollbar{    width: 0;}#scrollpath{    position: fixed;    top: 0;    right: 0;    width: 10px;    height: 100%;    background: rgba(255,255,255,0.05);}#progressbar{    position: fixed;    top: 0;    right: 0;    width: 10px;    background: linear-gradient(to top,#008aff,#00ffe7);    animation: animate 5s linear infinite;}@keyframes animate{    0%,100%{        filter:hue-rotate(0deg);    }    50%{        filter:hue-rotate(360deg);    }}#progressbar:before{    content: '';    position: absolute;    top: 0;    left: 0;    width: 100%;    height: 100%;    background: linear-gradient(to top,#008aff,#00ffe7);    filter: blur(10px);}#progressbar:after{    content: '';    position: absolute;    top: 0;    left: 0;    width: 100%;    height: 100%;    background: linear-gradient(to top,#008aff,#00ffe7);    filter: blur(30px);}
复制代码

演示地址: https://mp3.wf

免责声明

1.本网站所收集的部分公开资料来源于互联网,转载的目的在于传递更多信息及用于网络分享,并不代表本站赞同其观点和对其真实性负责,也不构成任何其他建议。
2.如果您发现网站上有侵犯您的知识产权的作品,请与我们取得联系,我们会及时修改或删除。

上一篇:Discuz!设置修改单个标签长度的方法 New
下一篇:如何支持首页四格图文并茂并可以在手机端显示精华帖子 New

回复

使用道具 举报

120

主题

292

回帖

516

积分

高级会员

积分
516
发表于 2024-2-23 11:28:07 | 显示全部楼层
效果很炫酷,谢谢分享,不过不适合应用于我的网站
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

快速回复 返回顶部 返回列表