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

推荐订阅源

PCI Perspectives
PCI Perspectives
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
C
CXSECURITY Database RSS Feed - CXSecurity.com
P
Palo Alto Networks Blog
S
Schneier on Security
Scott Helme
Scott Helme
T
Threat Research - Cisco Blogs
K
Kaspersky official blog
Microsoft Azure Blog
Microsoft Azure Blog
T
The Exploit Database - CXSecurity.com
C
Cybersecurity and Infrastructure Security Agency CISA
T
Tenable Blog
G
GRAHAM CLULEY
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
I
Intezer
D
Docker
月光博客
月光博客
L
Lohrmann on Cybersecurity
Latest news
Latest news
B
Blog
罗磊的独立博客
M
MIT News - Artificial intelligence
S
Securelist
Know Your Adversary
Know Your Adversary
Help Net Security
Help Net Security
Recorded Future
Recorded Future
S
SegmentFault 最新的问题
N
Netflix TechBlog - Medium
T
Threatpost
H
Hacker News: Front Page
K
KPMG report finds enterprise disconnect between AI and its ROI | CIO
人人都是产品经理
人人都是产品经理
F
Fortinet All Blogs
博客园 - Franky
P
Proofpoint News Feed
大猫的无限游戏
大猫的无限游戏
Blog — PlanetScale
Blog — PlanetScale
有赞技术团队
有赞技术团队
博客园 - 【当耐特】
A
About on SuperTechFans
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
T
Tor Project blog
Google Online Security Blog
Google Online Security Blog
Application and Cybersecurity Blog
Application and Cybersecurity Blog
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
Engineering at Meta
Engineering at Meta
Webroot Blog
Webroot Blog
Security Archives - TechRepublic
Security Archives - TechRepublic
Microsoft Security Blog
Microsoft Security Blog

博客园 - jack_Meng

WinForm 双屏开发中屏幕适配与窗口定位 高考志愿填报之计算机类专业院校报考指南(2026版) WebSocket 快速入门教程(附示例源码) 自动生成项目工具--AutoBuilder,一键干掉80%的重复CRUD工作 C#/.NET/.NET Core优秀项目和框架2026年5月简报 在Win10系统中,默认使用照片查看器 C#实现控制台多区域输出 解决: 您的连接不是私密连接,您目前无法访问 因为此网站使用了 HSTS 小说下载 网页版时间,可全屏显示 个人笔记本连接公共WIFI的安全措施 追更 HelloGitHub 一整年,年度盘点 基于Rust开发的m3u8下载器M3U8Quicker:支持断点续传、边下边播 新写了个直播录制工具,可录制抖音快手斗鱼直播 bing 每日一图 --- 桌面壁纸 一款基于 C# 开发的 Windows 10/11 系统增强优化工具 适合个人的免费域名 语雀里存了三年的笔记,导出到了本地插件----YuqueOut C# 也能像 Python 一样写脚本 | .NET 10 构建基于文件的应用 使用bat批量给txt追加内容 Python摄像头监控:运动检测+自动录像+时间水印 【译】告别繁琐查错:认识下新的 Visual Studio Debugger Agent Workflow 好消息,在 Visual Studio 中可以免费使用 GitHub Copilot 了! [C#] 零依赖高性能跨平台 Web 胶水库 -- PicoServer 我的第一款独立产品--TaskManager 写 EF Core 查询,优化查询语句 最新.NET新手入门学习网站合集(2026更新版) Avalonia UI:.NET 跨平台桌面开发的“真香”选择 一个 txt 生成并保存 mp3的 Python 脚本
js 双击页面 开始/暂停 页面滚动
jack_Meng · 2026-05-05 · via 博客园 - jack_Meng

当网页中有长篇文章时,浏览起来就比较吃劲了,想想一边忙着拖动滚动条,一边忙着浏览,确实挺累人的。为了客人能够轻松的浏览,我们可以使用script代码实现网页的自动滚屏,当双击网页的时候,网页将会自动向下滚动,再次单击时滚动停止。

这种方法适用于大多数浏览器,但需要注意的是,直接控制滚动条的滚动在某些浏览器中可能不被支持,特别是对于非用户触发的滚动行为(如平滑滚动)。但是,我们可以使用定时器来模拟暂停和恢复滚动。

<!DOCTYPE html>
<html>
 <head> 
  <title>双击滚动代码</title> 
 </head> 
 <body> 
 
 <button id="a1">-</button>
 <input type="number" id="t1" disabled="disabled" value="0" style="text-align:center;">
 <button id="j1">+</button>
 <hr/>
 <hr/>
 <div style="height:1500px;">
 </div>
 
    <script>
        
var currentpos,timer;
function initialize()
{
    timer=setInterval("scrollwindow()",30);
}

function sc(){
    clearInterval(timer);
}

function scrollwindow(){
    if(document.body.scrollTop){//加了DTD头时,document.body.scrollTop值始终为0,在此判断一下
        currentpos=document.body.scrollTop;
        window.scroll(0,++currentpos);
            if (currentpos != document.body.scrollTop){
                sc();
            }
    }
    else{
        currentpos=document.documentElement.scrollTop;
            window.scroll(0,++currentpos);
            if (currentpos != document.documentElement.scrollTop){
                sc();
            }
    }
}
 
document.onmousedown=sc
document.ondblclick=initialize
    
    </script>
 </body>
</html>

2026-05-05 19:07:35【出处】:https://www.cnblogs.com/xinlvtian/p/8482801.html

2026-05-05 19:07:35【出处】:https://blog.csdn.net/polloo2012/article/details/145342417

=======================================================================================

个人使用

根据上面的内容进行优化。可以直接在网页的console运行

<script>
        
    var currenTpos,scTimer;
    function scrollwindow(){
        //加了DTD头时,document.body.scrollTop值始终为0,在此判断一下
        currenTpos=document.body.scrollTop;
        currenTpos=document.documentElement.scrollTop;
        window.scroll(0,++currenTpos);
        if (currenTpos != document.documentElement.scrollTop)
            clearInterval(scTimer),scTimer=0;
    }
    //在页面上绑定双击事件执行,滚动速度,数值越大,滚动越慢
    document.ondblclick=()=>{scTimer=scTimer?clearInterval(scTimer):setInterval("scrollwindow()",90);}

</script>