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

推荐订阅源

N
News | PayPal Newsroom
Security Archives - TechRepublic
Security Archives - TechRepublic
Hacker News: Ask HN
Hacker News: Ask HN
H
Hacker News: Front Page
Apple Machine Learning Research
Apple Machine Learning Research
TaoSecurity Blog
TaoSecurity Blog
Help Net Security
Help Net Security
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
V
V2EX
Hugging Face - Blog
Hugging Face - Blog
cs.CV updates on arXiv.org
cs.CV updates on arXiv.org
cs.CL updates on arXiv.org
cs.CL updates on arXiv.org
人人都是产品经理
人人都是产品经理
博客园 - 三生石上(FineUI控件)
Security Latest
Security Latest
Cloudbric
Cloudbric
WordPress大学
WordPress大学
S
SegmentFault 最新的问题
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
www.infosecurity-magazine.com
www.infosecurity-magazine.com
Know Your Adversary
Know Your Adversary
A
Arctic Wolf
L
LangChain Blog
Application and Cybersecurity Blog
Application and Cybersecurity Blog
The GitHub Blog
The GitHub Blog
P
Proofpoint News Feed
W
WeLiveSecurity
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
M
MIT News - Artificial intelligence
Google DeepMind News
Google DeepMind News
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
The Cloudflare Blog
小众软件
小众软件
NISL@THU
NISL@THU
云风的 BLOG
云风的 BLOG
P
Privacy & Cybersecurity Law Blog
S
Security @ Cisco Blogs
博客园 - 【当耐特】
I
InfoQ
Vercel News
Vercel News
CTFtime.org: upcoming CTF events
CTFtime.org: upcoming CTF events
P
Proofpoint News Feed
O
OpenAI News
Google DeepMind News
Google DeepMind News
N
News and Events Feed by Topic
K
KPMG report finds enterprise disconnect between AI and its ROI | CIO
K
Kaspersky official blog
T
Threat Research - Cisco Blogs
量子位
宝玉的分享
宝玉的分享

博客园 - 小张.NET

模仿写了一个摸鱼应用解决原作者的问题 C#多线程中访问winform控件 (解决Winform 对象当前正在其他地方使用) 变化的科技感十足的网站,推荐 新年有感 获取高精度时间注意事项 (QueryPerformanceCounter , QueryPerformanceFrequency) 修改 TeamViewer ID 的方法 VS2017离线安装包[百度云盘](收藏了) 老子今天不加班,程序员也需要自由 改变Eclipse 中代码字体大小 去除 VS.Net 2003 项目的 VSS 息的脚本 字符串截取固定长度的方法(C#) 两种彻底删除VIEWSTATE的方法 - 小张.NET - 博客园 对路径XXX的访问被拒绝(文件操作权限)的解决方法 安装VS2005 SP1之后无法更改或卸载VS2005的处理方法 VS2005的隐藏快捷键 vs2005的快捷键 反编译工具Reflector下载(集成两个常用.net插件,FileGenerator和FileDisassembler) 强大的.NET反编译工具Reflector及插件 程序员,你离坐牢还有多远 - 小张.NET - 博客园
第一屏不显示懒加载的图片内容,这个方法可以搞定
小张.NET · 2020-05-08 · via 博客园 - 小张.NET

今天在处理大量图片加载时用到了jquery.lazyload。jquery.lazyload将图片延迟加载封装起来了,确实挺好用。但是过程中遇到一个问题,就是默认的第一页图片没有加载出来,必须滚动一下滚动条才能加载出来。通过查看源码发现window的resize事件有绑定jquery.lazyload的延迟加载功能,则在设置延迟加载绑定后触发一下window的resize事件即可。

在引入对应的js文件后,页面添加如下js代码即可:

function LazyLoad() {
    $(function () {
        $("img").lazyload({
            container: $("#photo_panel"),
        });
        setTimeout(function () {
            $(window).trigger("resize");
        }, 50);
    });
}