Created
February 27, 2013 11:57
-
-
Save alanfluff/5047413 to your computer and use it in GitHub Desktop.
Picturefill markup with ProcessWire image sizing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
From Marty Walker Pastie | |
Picturefill markup with ProcessWire image sizing | |
https://github.com/scottjehl/picturefill/ | |
http://processwire.com/ | |
*/ | |
<div data-picture data-alt='{$page->title}'> | |
<div data-src='{$image->size(50,0)->url}'></div> | |
<div data-src='{$image->size(375,0)->url}' data-media='(min-width: 400px)'></div> | |
<div data-src='{$image->size(480,0)->url}' data-media='(min-width: 800px)'></div> | |
<div data-src='{$image->size(688,0)->url}' data-media='(min-width: 1000px)'></div> | |
<!-- Fallback content for non-JS browsers. Same img src as the initial, unqualified source element. --> | |
<noscript><img src='{$image->size(375,0)->url}' alt='{$page->title}'></noscript> | |
</div> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment