[HTML5] Lazyload below the fold images and iframes with native browser lazy-loading
In this lesson, you'll learn how to use the loading="lazy"
attribute available on images and iframes to lazily load below the fold images, which saves bandwidth and increases the load time performance of web pages. You'll also learn how to prevent images from lazy loading if necessary, and how to add lazy loading to responsive images as well. Lazy loading is supported in Chrome 76, and will be available in the next version of Edge and has public signals of support from Firefox, and Safari as well.
<!DOCTYPE html>
<style>
img {
border: 1px solid black;
display: block;
width: 400px;
height: 1000px;
}
</style>
<img loading="lazy" src="https://via.placeholder.com/400x1000"/>
<img loading="lazy" src="https://via.placeholder.com/400x1001"/>
<img loading="lazy" src="https://via.placeholder.com/400x1002"/>
<img loading="lazy" src="https://via.placeholder.com/400x1003"/>
<picture>
<source media="(min-width: 100px)" srcset="https://via.placeholder.com/1200x3000">
<img loading="lazy" src="https://via.placeholder.com/400x1004"/>
</picture>
<img loading="lazy"
srcset="https://via.placeholder.com/400x1005 400w, https://via.placeholder.com/800x2010 800w"/>
<iframe loading="lazy" src="http://example.com" width="400" height="400"></iframe>
[HTML5] Lazyload below the fold images and iframes with native browser lazy-loading的更多相关文章
- jQuery.lazyload使用及源码分析
前言: 貌似以前自己也写过图片懒加载插件,但是新公司使用的是jQuery.lazyload插件,为了更好的运用,自己还是把源码看了遍,分别记录了如何使用, 插件原理,各个配置属性的完整解释,demo实 ...
- LazyLoad.js及scrollLoading.js
http://blog.csdn.net/ning109314/article/details/7042829 目前图片延迟加载主要分两大块,一是触发加载(根据滚动条位置加载图片):二是自动预加载(加 ...
- JQuery LazyLoad实现图片延迟加载-探究
对于大量图片的网站,图片延迟加载是提高速度和性能的好方法. 目前图片延迟加载主要分两大块,一是触发加载(根据滚动条位置加载图片):二是自动预加载(加载完首屏后n秒后自动加载其他位置的图片).大体常用的 ...
- JS怎样实现图片的懒加载以及jquery.lazyload.js的使用
在项目中有时候会用到图片的延迟加载,那么延迟加载的好处是啥呢? 我觉得主要包括两点吧,第一是在包含很多大图片长页面中延迟加载图片可以加快页面加载速度:第二是帮助降低服务器负担. 下面介绍一下常用的延迟 ...
- 前端性能优化成神之路--图片懒加载(lazyload image)
图片懒加载(当然不仅限于图片,还可以有视频,flash)也是一种优化前端性能的方式.使用懒加载可以想要看图片时才加载图片,而不是一次性加载所有的图片,从而在一定程度从减少服务端的请求 什么是懒加载 懒 ...
- [转]LazyLoad.js及scrollLoading.js
本文转自:http://blog.csdn.net/ning109314/article/details/7042829 目前图片延迟加载主要分两大块,一是触发加载(根据滚动条位置加载图片):二是自动 ...
- 两种图片延迟加载的方法总结jquery.scrollLoading.js与jquery.lazyload.js
估计网上能查到的最多的两种图片延迟加载方法就是jquery.scrollLoading.js与jquery.lazyload.js了,其中jquery.lazyload.js的调用方法因为有网友爆出的 ...
- 两种图片延迟加载的方法总结jquery.scrollLoading.js与jquery.lazyload.js---转载
jquery.scrollLoading方法 html <!DOCTYPE html> <html xmlns="http://www.w3.org/1999/xhtml& ...
- 图片懒加载jquery lazyload
<script type="text/javascript" src="jquery-1.11.3.min.js"></script>& ...
随机推荐
- Java操作word转pdf
如果转换后出现乱码,是doc格式的文档的话请转换为docx!!! 下载相关jar包和一个授权到2099年的凭证文件. 链接: https://pan.baidu.com/s/1xudkKqR1-TLL ...
- java中不常见的关键字:strictfp
1.strictfp, 即 strict float point (精确浮点). strictfp 关键字可应用于类.接口或方法.使用 strictfp 关键字声明一个方法时,该方法中所有的float ...
- python第一个浏览器的自动执行程序
1.目标:简单点,百度搜索“美丽的程序员” 2.操作方法: a.python已经安装完成 b.安装PIP:在windows的cmd窗口下输入easy_install pip c.安装sele ...
- Django 1.8.2 admin 数据库操作按下保存按钮出错
Django报错:Runtimeerror: generator raised StopIteration python版本太新不兼容照成,下载python3.6就行了
- StarUML3.1.0版(2019.3.6)生成Java代码
下载官网 StarUML3.1.0(2019.3.6) 步骤 打开StarUML: 点击菜单栏的Tools: 列表中如果有Java,说明已经有这个生成Java代码的扩展了: 列表里如果没有Java: ...
- go 实现每次生成不同随机值
直接使用rand.Intn(10) 多次运行发现每次的随机值都是一样的 查看 Intn方法的源码说明 // Intn returns, as an int, a non-negative pseudo ...
- Golang不会自动把slice转换成interface{}类型的slice
目录 例子 原因 如何去实现 例子 我们时常会写一些interface,例如: type A interface{ Print() } type B struct { } func (b *B) Pr ...
- 50道高级sql练习题;大大提高自己的sql能力(附具体的sql)
问题及描述:--1.学生表Student(SID,Sname,Sage,Ssex) --SID 学生编号,Sname 学生姓名,Sage 出生年月,Ssex 学生性别--2.课程表Course(CID ...
- xposed自定义参数
java反射机制允许在不显式调用类及类方法的前提下,实现创建类对象.调用类方法等一系列操作. 目标函数为TestArray,其参数为我们自定义的Person类的数组. public class tes ...
- Vue router link
html: <router-link to="test">Go to Foo</router-link> <router-link to=" ...