Skip to content


Subversion checkout URL

You can clone with
Download ZIP
tree: 907f259228
45 lines (45 sloc) 2.077 kB
<!DOCTYPE html>
<html lang="en">
<meta charset="utf-8" />
body {
font-family: sans-serif;
.wrap {
width: 75%;
max-width: 800px;
margin: 2em auto;
img {
width: 100%;
border: none;
pre {
overflow: auto;
padding: 1em;
border: 1px solid #999;
<title>Responsive Enhance</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<div class="wrap">
<h1>Responsive Enhance</h1>
<p>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.</p>
<p><img id="demo1" src="" alt="Responsive Image" data-fullsrc=""></p>
<p><pre><code>&lt;img id="demo1" src="" alt="Responsive Image" data-fullsrc=""&gt;
&lt;script&gt;responsiveEnhance(document.getElementById('demo1'), 400);&lt;/script&gt;</code></pre></p>
<p>Here's a photo of some lovely star biscuits that <a href="">@qwertykate</a> bought us. Image courtesy of <a href="">adactio</a>.</p>
<p><a href=""><img id="demo2" src="" alt="Responsive Image" data-fullsrc=""></a></p>
<p><pre><code>&lt;img id="demo2" src="" alt="Responsive Image" data-fullsrc=""&gt;
&lt;script&gt;responsiveEnhance(document.getElementById('demo2'), 240);&lt;/script&gt;</code></pre></p>
<script src="responsive-enhance.js"></script>
responsiveEnhance(document.getElementById('demo1'), 400);
responsiveEnhance(document.getElementById('demo2'), 240);
Jump to Line
Something went wrong with that request. Please try again.