定制 scottjehl/picturefill 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

scottjehl/picturefill

最新稳定版本:3.0.3

Composer 安装命令:

composer require scottjehl/picturefill

包简介

A responsive image polyfill for <picture>, srcset, sizes, and more.

README 文档

README

A responsive image polyfill.

This project is archived and deprecated!

At the time, it helped us transition to responsive image HTML patterns until browsers supported them. Support and fallback strategies are now very good, and this project is no longer needed or recommended. Thanks everyone!`

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:

<picture> <source srcset="../img/sample.svg" media="(min-width: 768px)" /> <img srcset="default.png" alt="Sample pic" /> </picture>
  • 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:
<picture> <source srcset="../img/sample.svg" media="(min-width: 768px)" /> <img srcset="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==" alt="Sample pic" /> </picture>

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.

scottjehl/picturefill 适用场景与选型建议

scottjehl/picturefill 是一款 基于 JavaScript 开发的 Composer 扩展包,目前已累计 31.08k 次下载、GitHub Stars 达 10.03k, 最近一次更新时间为 2026 年 01 月 04 日, 在 PHP 生态内属于活跃度较高的组件。

我们在过去多个企业项目中使用过 scottjehl/picturefill 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。

围绕 scottjehl/picturefill 我们能提供哪些服务?
定制开发 / 二次开发

基于 scottjehl/picturefill 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。

BUG 修复 & 性能优化

线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。

项目外包 & 长期维护

承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。

yvsm@zunyunkeji.com QQ:316430983 微信:yvsm316 西安尊云信息科技 · 专注 PHP / Go / 分布式系统研发

统计信息

  • 总下载量: 31.08k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 10029
  • 点击次数: 39
  • 依赖项目数: 1
  • 推荐数: 0

GitHub 信息

  • Stars: 10029
  • Watchers: 354
  • Forks: 1128
  • 开发语言: JavaScript

其他信息

  • 授权协议: MIT
  • 更新时间: 2026-01-04