Skip to content


Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Javascript to load a larger image where necessary
branch: master

This branch is 4 commits behind joshje:master

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.

Responsive Enhance

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

<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.

Something went wrong with that request. Please try again.