Forked from alanfluff/ProcessWire: PHP: Picturefill markup
Created
June 15, 2014 22:39
-
-
Save mr-fan/53472be67bf176a7c8f8 to your computer and use it in GitHub Desktop.
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