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

推荐订阅源

cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
Blog — PlanetScale
Blog — PlanetScale
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
The Last Watchdog
The Last Watchdog
AI
AI
Recent Announcements
Recent Announcements
Recent Commits to openclaw:main
Recent Commits to openclaw:main
Stack Overflow Blog
Stack Overflow Blog
V
Visual Studio Blog
J
Java Code Geeks
TaoSecurity Blog
TaoSecurity Blog
L
LangChain Blog
Exploit-DB.com RSS Feed
Exploit-DB.com RSS Feed
Project Zero
Project Zero
Microsoft Security Blog
Microsoft Security Blog
量子位
T
Threatpost
CTFtime.org: upcoming CTF events
CTFtime.org: upcoming CTF events
博客园 - Franky
博客园 - 聂微东
L
LINUX DO - 最新话题
Security Archives - TechRepublic
Security Archives - TechRepublic
Hugging Face - Blog
Hugging Face - Blog
T
The Blog of Author Tim Ferriss
P
Proofpoint News Feed
The GitHub Blog
The GitHub Blog
C
Check Point Blog
宝玉的分享
宝玉的分享
G
Google Developers Blog
Spread Privacy
Spread Privacy
Cloudbric
Cloudbric
SecWiki News
SecWiki News
有赞技术团队
有赞技术团队
www.infosecurity-magazine.com
www.infosecurity-magazine.com
W
WeLiveSecurity
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
美团技术团队
V
Vulnerabilities – Threatpost
Cyberwarzone
Cyberwarzone
A
Arctic Wolf
P
Privacy & Cybersecurity Law Blog
P
Palo Alto Networks Blog
H
Help Net Security
cs.CV updates on arXiv.org
cs.CV updates on arXiv.org
Cisco Talos Blog
Cisco Talos Blog
Hacker News - Newest:
Hacker News - Newest: "LLM"
A
About on SuperTechFans
N
Netflix TechBlog - Medium
罗磊的独立博客
月光博客
月光博客

博客园 - hiaming

doclever 5.5.1 安装及升级【原创】 SPARROW-JS 从0开始写 0依赖,原生JS框架 Sparrow算法篇 从日期取交集到思维模式-2 高性能轻量级markdown 解析器java 版sparrow-markdown Sparrow 算法篇 由日期取交集到思维模式 自己动手写mvc框架SPARROW MVC REDIS客户端封装实践2 SPARROW 框架redis客户端封装实践 SPARROW架构介绍 Sparrow 框架设计哲学 陌院俅颗难炎先当粮澜 openresty在centos/redhat6.7上部署 tomcat 日志那点事 Redhat6.7 切换Centos yum源 Quartz corn时间表达式(转) fastjson排序 Map多层嵌套转换自动排序问题终极解决方案 Spring 外部注入Bean (JAX-WS) SSH,如何恢复通过输入密码的方式来登录服务器 Redhat Linux6.5 开启VNC 远程桌面
Jquery控制滚动Div 滚动条事件
hiaming · 2016-09-14 · via 博客园 - hiaming

    $('#classifyTree')
     .bind('mousewheel', function(event) {
         var realScrollHeight=event.currentTarget.clientHeight+event.currentTarget.scrollTop;
         //如果向下滚动大于最终滚动高度后
         if(realScrollHeight >=event.currentTarget.scrollHeight){
             if(event.originalEvent.wheelDelta>0){
                 //向上滚动
                 return true;
             }
             return false;
         }else{
             //如果滚动条最终距离为0,不允许再向上滚动
             if(event.currentTarget.clientHeight==realScrollHeight){ 
                 //如果滚动条小于最终高度
                 if(event.originalEvent.wheelDelta<0){
                     //向下滚动
                     return true;
                }
                 return false;
             }
         }
         return true;
     });

最近项目中出现一个页面中有多个Div滚动,这样用户体验是非常不爽的,主要原因在于如果用滚轮滚动滚动条到最顶部或最底部,他外层的滚动条也会跟着滚动,这样会让人眩晕,,出于这个问题,写了一个指定区域内滚动限制方法,如下: