samedi 21 février 2015

responsive images srcset not working

I've been trying to implement the new srcset approach to responsive images, using the following HTML



<img class="swapImages"
srcset="assets/images/content/large.jpg 1200w,
assets/images/content/medium.jpg 800w,
assets/images/content/small.jpg 400w"
sizes="100vw"
src="assets/images/content/small.jpg"
alt="responsive image">


Im using chrome 40 and all I get is the largest image, resizing my browser, clearing the cache does nothing.


I read somewhere I had to polyfill, so I used the picturefill plugin, although chrome should support it.....still doesn't work.


I put together a demo page for it: http://ift.tt/1JwQKwD


What am I doing wrong/not getting?


Any help is massively appreciated.


Aucun commentaire:

Enregistrer un commentaire