Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Javascript to load a larger image where necessary

tree: 91a4df8913

Fetching latest commit…

Octocat-spinner-32-eaf2f5

Cannot retrieve the latest commit at this time

Octocat-spinner-32 index.html
Octocat-spinner-32 readme.md Fixed spelling of "neccessary" [sic]
Octocat-spinner-32 responsive-enhance.js
readme.md

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="http://dummyimage.com/400x300" alt="Responsive Image" data-fullsrc="http://dummyimage.com/800x600">
<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.