Home

Awesome

progressive-image.js

demonstration | GitHub | npm | donate | @craigbuckler | craigbuckler.com

progressive-image.js implements a progressively-loaded image effect similar to those seen on Facebook and Medium. A very small blurred image is replaced with the full-resolution equivalent when the element is scrolled into view.

Please use the code as you wish. Tweet me @craigbuckler if you find it useful and consider donating toward development.

Benefits:

View demonstration and full documentation...

Basic usage

Include the minified CSS and JavaScript anywhere in your page:

<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/progressive-image.js/dist/progressive-image.css">
<script src="https://cdn.jsdelivr.net/npm/progressive-image.js/dist/progressive-image.js" async></script>

or use npm and a bundler:

npm i progressive-image.js

Then add progressively-loaded images:

<a href="full.jpg" class="progressive replace">
  <img src="tiny.jpg" class="preview" alt="image" />
</a>

where:

Both images must have the same aspect ratio.

Refer to demo.html for full documentation, examples, options, and usage notes. It is also available as a CodePen demonstration page.

Version history

v1.6.1, 2 October 2021

v1.6.0, 3 July 2020

v1.5.0, 6 June 2020

v1.4.1, 9 July 2019

v1.4.0, 24 June 2019

v1.3.0, 30 May 2019

v1.2.0, 13 April 2018

v1.2.0, 9 April 2018

v1.1.0, 25 November 2017

v1.0.0, 16 January 2017