We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
图片加载一个老生常谈的问题,由于最近工作中经常有h5宣传页的需求,所以也看了一些方案
<!-- figure,代表一段独立的内容,常用语引用图片、插图、表格、代码段等等 --> <figure> <!-- 图片容器 --> <div class="aspectRatioPlaceholder is-locked" style="max-width: 383px; max-height: 326px;"> <!-- 放置reflow的占位元素,style上的padding-bottom是通过接下来相邻div上写好的图片宽高计算而来,可通过十字相乘得到高度百分比 --> <div class="aspectRatioPlaceholder-fill" style="padding-bottom: 85.1%;"></div> <!-- 实际的图片信息,包括图片id和图片宽高 --> <div data-image-id="1*MZY5pNF7fgOarY-J2fNuHQ.png" data-width="383" data-height="326"> <!-- 可以看到png后缀后有一个query: ?q=20,这个是缩略图的质量,猜想是二十分之一? --> <img src="https://cdn-images-1.medium.com/freeze/max/60/1*MZY5pNF7fgOarY-J2fNuHQ.png?q=20" crossorigin="anonymous"> <!-- 获取上面的图片,渲染到canvas中,canvas宽高为实际的图片宽高,并添加高斯模糊效果,以获取较好的用户体验 --> <canvas></canvas> <!-- 真正的图片 --> <img src="https://cdn-images-1.medium.com/max/1600/1*MZY5pNF7fgOarY-J2fNuHQ.png"> <!-- 向后兼容,在不支持js脚本或者支持js脚本,但认为禁止js脚本的浏览器中可以被识别 --> <noscript> <img src="https://cdn-images-1.medium.com/max/1600/1*MZY5pNF7fgOarY-J2fNuHQ.png"> </noscript> </div> </div> </figure>
The text was updated successfully, but these errors were encountered:
No branches or pull requests
图片加载一个老生常谈的问题,由于最近工作中经常有h5宣传页的需求,所以也看了一些方案
The text was updated successfully, but these errors were encountered: