scottjehl/picturefill

Picturefill
A responsive image polyfill.

Authors: See Authors.txt
License: MIT
build-status Join Slack channel picturefill on npm

Picturefill has three versions:

Version 1 mimics the Picture element pattern with span elements. It is no longer maintained.
Version 2 is a lightweight polyfill of the Picture element draft specification.
Version 3.0.3 is the current stable release.
Usage, Demos, Docs
To find out how to use Picturefill, visit the project site.

The gotchas
Be it browser issues, the responsive images specifications, or Picturefill itself, there are a couple gotchas you should be aware of when working with Picturefill:

Firefox 38 and 39 has some bugs [1] [2] [3] where images won’t update on screen resize. These issues are addressed by Picturefill 3.0.0, and was fixed in Firefox 41.

Per the picture spec, using % isn’t allowed in the sizes attribute. Using % will fallback to 100vw.

Trying to use the src attribute in a browser that doesn’t support picture natively can result in a double download. To avoid this, don’t use the src attribute on the img tag:

Sample pic If you only want to have an image show up at certain sizes, and not show up at others, you will need to use a transparent placeholder gif: Sample pic Contributing For information on how to contribute code to Picturefill, check out CONTRIBUTING.md

Issues
If you find a bug in Picturefill, please add it to the issue tracker

Discussion
Picturefill discussion takes place via Slack. For an invitation, visit https://pf-slackin.herokuapp.com/

Support
There are currently no known unsupported browsers, provided that you use the markup patterns provided.

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值