Repository: joshje/Responsive-Enhance Branch: master Commit: 907f2592280a Files: 3 Total size: 3.7 KB Directory structure: gitextract_5zblforw/ ├── index.html ├── readme.md └── responsive-enhance.js ================================================ FILE CONTENTS ================================================ ================================================ FILE: index.html ================================================
Depending on the size of your viewport, you may see a 400px by 300px wide image, or a 800px by 600px image. Try refreshing the page with a small or wide browser window. The standard image is always downloaded, full images are then downloaded as needed.
<img id="demo1" src="http://dummyimage.com/400x300" alt="Responsive Image" data-fullsrc="http://dummyimage.com/800x600">
<script>responsiveEnhance(document.getElementById('demo1'), 400);</script>
Here's a photo of some lovely star biscuits that @qwertykate bought us. Image courtesy of adactio.
<img id="demo2" src="http://farm8.staticflickr.com/7022/6806617685_3be0d007c3_m.jpg" alt="Responsive Image" data-fullsrc="http://farm8.staticflickr.com/7022/6806617685_b793771008_o.jpg">
<script>responsiveEnhance(document.getElementById('demo2'), 240);</script>