PicturePolyfill 4 is out! Implementing responsive images in your site has never been so simple and fast.

Responsive image

Most important features

  • the source parsing algorithm behavior: it now exits at the first matching media query instead of at the last one, as the native implementation does
  • one img tag is now mandatory, as defined in the picture tag specification
  • the srcset attribute inside the img tag is now better managed, in browsers that support it
  • the script is now lighter than before, because the functions to create the img tag were removed
  • the script is now even faster because it now parses only the matching srcset attribute, and not all of them as before
  • the internal cache system is still in place and working fine but  you can avoid using it (just in case you need to) passing a parameter

Installation - Manually

  • Download picturePolyfill from GitHub
  • Include the minified file in your project script directory

Installation - Using bower

You can install the latest version of picturePolyfill using bower. Just enter the following command in the Terminal, and it’s done.

bower install picturePolyfill