bbc / Imager.js

Responsive images while we wait for srcset to finish cooking
Apache License 2.0
3.84k stars 224 forks source link

{width} Interpolation in data-src #16

Closed thom4parisot closed 11 years ago

thom4parisot commented 11 years ago

tl;dr

data-src does not always comply with {width} being replaced by a numeric value.
{width} is now replaceable any width breakpoint by any value of your choice using the availableWidths option.

Relies on #15 to be merged.

Features

data-src

<div data-src="http://farm4.staticflickr.com/3773/9676470682_3d418eeb40_{width}.jpg"> -> :

The array of widths now accepts array-like values:

A demo showcases this using Flickr URL system.

Integralist commented 11 years ago

I've closed the #15 PR and so I'm closing this by association as it closely relies on it.