Last active
October 4, 2015 19:58
-
-
Save xavez/2690551 to your computer and use it in GitHub Desktop.
Responsive Images
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
<img src="image.jpg" setsrc="image.xml" /> | |
<!-- And your image.xml being something like --> | |
<img media="screen and (min-width:500px)"> | |
<coords> | |
<rect width="700" height="550" x="0" y="0" id="square" /> | |
</coords> | |
<source>image.jpg</source> | |
</img> | |
<img media="max-width:500px"> | |
<coords> | |
<rect width="500" height="500" x="100" y="50" id="square" /> | |
</coords> | |
<source>image.jpg</source> | |
</img> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Interesting idea!
Have been trying to do something similar, hacking around with css background-size, background-position, html data-attribute, injecting the coords in the back-end.