Javascript to load a larger image where necessary
Failed to load latest commit information.
index.html Ensure class is added before modifying the source to avoid stack over… Jun 13, 2012

Responsive Enhance

This script will check whether an image is larger than a specified width and load a full resolution image if necessary.

<img id="demo" src="" alt="Responsive Image" data-fullsrc="">
<script>responsiveEnhance(document.getElementById('demo'), 400);</script>

This will replace the image with the image defined in the data-fullsrc when the image is wider than 400 pixels.