惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

S
Secure Thoughts
Security Latest
Security Latest
Simon Willison's Weblog
Simon Willison's Weblog
O
OpenAI News
GbyAI
GbyAI
L
LINUX DO - 最新话题
A
Arctic Wolf
T
Tor Project blog
G
GRAHAM CLULEY
I
InfoQ
博客园_首页
IT之家
IT之家
The Register - Security
The Register - Security
Exploit-DB.com RSS Feed
Exploit-DB.com RSS Feed
P
Proofpoint News Feed
The GitHub Blog
The GitHub Blog
Blog — PlanetScale
Blog — PlanetScale
N
Netflix TechBlog - Medium
K
Kaspersky official blog
博客园 - 三生石上(FineUI控件)
S
SegmentFault 最新的问题
U
Unit 42
PCI Perspectives
PCI Perspectives
量子位
P
Palo Alto Networks Blog
S
Securelist
T
Troy Hunt's Blog
博客园 - 【当耐特】
Recorded Future
Recorded Future
K
KPMG report finds enterprise disconnect between AI and its ROI | CIO
S
Security Affairs
Engineering at Meta
Engineering at Meta
T
The Blog of Author Tim Ferriss
博客园 - 聂微东
罗磊的独立博客
N
News and Events Feed by Topic
人人都是产品经理
人人都是产品经理
B
Blog RSS Feed
NISL@THU
NISL@THU
C
Cisco Blogs
T
Threatpost
有赞技术团队
有赞技术团队
Forbes - Security
Forbes - Security
Hugging Face - Blog
Hugging Face - Blog
Last Week in AI
Last Week in AI
T
The Exploit Database - CXSecurity.com
Cloudbric
Cloudbric
Cyberwarzone
Cyberwarzone
Google DeepMind News
Google DeepMind News
C
Cyber Attacks, Cyber Crime and Cyber Security

听得入迷空间

我买过什么主题 b站iframe宽度自适应 全站变灰 关于河南话学术研究待解决的问题|搬运笔记 静心诀、清心诀、冰心诀 阳光十六法则 光圈、感光度ISO、快门 喜迎72周年国庆|国旗知识 朝代歌 logo进化 机场 简单的书签导航页 简单的书签导航页 - 听得入迷空间 《竞选州长》 - 马克 · 吐温 安卓手机制作启动盘 - 听得入迷空间 logo进化 - 听得入迷空间 《星游记》全集新4K重置 - 听得入迷空间 解锁EdgeOne,免费CDN - 听得入迷空间 静心诀、清心诀、冰心诀 - 听得入迷空间 海绵宝宝1-13季分享 - 听得入迷空间 可商用免费字体-打包下载 - 听得入迷空间 Trae,简单可用的AI IDE - 听得入迷空间
添加网页动态滚动进度条|滚动指示器
听得入迷空间 · 2026-06-17 · via 听得入迷空间

添加网页动态滚动进度条|滚动指示器

技术教程 · 2026-06-17 · 1 分钟阅读

看到别人的博客网页顶部有一个页面翻动的进度条,页面滚动到哪里进度条也相应变动长短。自己也加了一个。

以下代码最好放到主head

<!--动态滚动进度条-->

<div class="scroll-line" style="z-index: 999;position: fixed;height: 3px;top: 0px;background-color: #6B999B;width: 0%;"></div>

<script type="text/javascript">

    $(window).scroll(function() {

        var winTop = $(window).scrollTop(), //滚动条的位置

                docHeight = $(document).height(),   //文档高度

                winHeight = $(window).height(); //窗口高度

 

        var scrolled = (winTop / (docHeight - winHeight))*100;

 

        $('.scroll-line').css('width', (scrolled + '%'));

    });

</script>

引用原文地址:https://blog.csdn.net/hbtj_1216/article/details/52555284